Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlazingMQ C SDK Initial Pull Request #169

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
3a34d45
Initial code
Oct 11, 2023
27ce71d
Added z_bmq to build configs
Oct 20, 2023
5f79d23
Made progress on CorrelatonId and QueueId
Oct 27, 2023
9f2ff58
Finished QueueOptions, and changed constructors to avoid C naming con…
Nov 8, 2023
f662467
Fixed minor errors
Nov 8, 2023
9190f2a
Added wrapper functions for Subscription, SubscriptionHandle, and Sub…
Nov 8, 2023
12fc043
Started Session implementation
Nov 10, 2023
031c034
Added headers for z_bmqa_Session
Nov 10, 2023
ccfa5e6
test
Nov 18, 2023
0efcb02
Initial implementation of z_bmqa_MessageEventBuilder
Nov 14, 2023
c208895
Initial implementation of z_bmqa_ConfirmEventBuilder
Nov 15, 2023
9459753
producer bare minimum
Dec 1, 2023
63b54cf
demo files + minor fixes
Dec 1, 2023
1849c31
More changes
Dec 1, 2023
2ee34f7
Got C producer working, will clean later
Dec 1, 2023
e4e2c92
fixed mem leak and switched '_ptr' to '_p' to comply with bloomberg s…
Dec 6, 2023
d21c924
Progress
Jan 23, 2024
0666ce9
Add CMakeLists.txt for c_wrapper
Jan 23, 2024
a69e978
Progress(2)
Jan 24, 2024
5a54f03
Add cmake edit
Jan 24, 2024
b079bf7
Initial code
Oct 11, 2023
7011a61
Added z_bmq to build configs
Oct 20, 2023
572e38c
Made progress on CorrelatonId and QueueId
Oct 27, 2023
8e188c3
Finished QueueOptions, and changed constructors to avoid C naming con…
Nov 8, 2023
232222d
Fixed minor errors
Nov 8, 2023
be3ef3f
Added wrapper functions for Subscription, SubscriptionHandle, and Sub…
Nov 8, 2023
29ee11e
Started Session implementation
Nov 10, 2023
02ef69c
Added headers for z_bmqa_Session
Nov 10, 2023
3e1c44c
test
Nov 18, 2023
a45f417
Initial implementation of z_bmqa_MessageEventBuilder
Nov 14, 2023
78d60c8
Initial implementation of z_bmqa_ConfirmEventBuilder
Nov 15, 2023
e937346
producer bare minimum
Dec 1, 2023
e35c2f3
demo files + minor fixes
Dec 1, 2023
a24c1f8
More changes
Dec 1, 2023
d03af92
Got C producer working, will clean later
Dec 1, 2023
5493d19
fixed mem leak and switched '_ptr' to '_p' to comply with bloomberg s…
Dec 6, 2023
cd3479e
Progress
Jan 23, 2024
f4bc2f9
Add CMakeLists.txt for c_wrapper
Jan 23, 2024
0eb49cc
Progress(2)
Jan 24, 2024
e1c2c8a
Merge pull request #1 from jonathanadotey77/c_wrapper
jonathanadotey77 Jan 24, 2024
94dc4fd
Merge remote-tracking branch 'simon/main' into c_wrapper
Jan 24, 2024
5101116
Added a way use member functions with a SessionEventHandler
Jan 25, 2024
c2e3856
Removed unused imports from consumer.cpp and added queueflags
Jan 25, 2024
7f492a6
Added tests for SessionEventType, MessageEventType, and CompressionAl…
Jan 26, 2024
1366de1
Merge pull request #2 from jonathanadotey77/c_wrapper
jonathanadotey77 Jan 26, 2024
d7c657d
Ran formatter and deleted demo.h
Jan 26, 2024
eb918c7
test
Simon-Sandrew Jan 26, 2024
3e7c907
Moved z_bmq into wrappers/z_bmq
Jan 26, 2024
a6d0ffc
Removed z_bmq_demo
Jan 26, 2024
a234e0c
Addressed some comments from the december PR
Jan 26, 2024
4962eca
Formatted z_bmqa_sessionevent.cpp
Jan 26, 2024
982e168
Merge pull request #5 from jonathanadotey77/main
Simon-Sandrew Jan 27, 2024
bcd3028
Updates (#7)
jonathanadotey77 Feb 6, 2024
5a7cb36
Fixing the buidl
Simon-Sandrew Feb 6, 2024
5325161
Made basic test for z_bmqa_sessionevent, not tested yet (#8)
kaanlus Feb 6, 2024
9a02d32
Merge branch 'bloomberg:main' into main
Simon-Sandrew Feb 13, 2024
a0e317b
Fork (#10)
Simon-Sandrew Mar 15, 2024
31aabe5
Kaan Changes (#11)
kaanlus Mar 15, 2024
eef8012
aaryaman changesbob (#12)
thuloj Mar 15, 2024
7578194
comments (#13)
Simon-Sandrew Mar 20, 2024
2a0c76c
Merge branch 'bloomberg:main' into main
Simon-Sandrew Mar 20, 2024
e5639c0
Update src/groups/wrappers/z_bmq/z_bmqa/z_bmqa_session.h
Simon-Sandrew Apr 16, 2024
88adfad
Fork (#16)
Simon-Sandrew Apr 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ CMakeUserPresets.json
/include/
/lib/
**/__pycache__/
/thirdparty
1 change: 1 addition & 0 deletions src/groups/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
add_subdirectory(mwc)
add_subdirectory(bmq)
add_subdirectory(mqb)
add_subdirectory(wrappers/z_bmq)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wrappers directory should be below src

9 changes: 9 additions & 0 deletions src/groups/wrappers/z_bmq/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# bmq
# ---


# Add the libbmq group library only installing the public headers
add_library(z_bmq)

target_bmq_style_uor( z_bmq )

63 changes: 63 additions & 0 deletions src/groups/wrappers/z_bmq/doc/z_bmq.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
z_bmq.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description needs updating


@PURPOSE: Public SDK API for the BlazingMQ framework.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@PURPOSE: Public SDK API for the BlazingMQ framework.
@PURPOSE: Public C SDK API for the BlazingMQ framework.


@MNEMONIC: BlazingMQ (bmq)

@DESCRIPTION: BlazingmQ (package group 'bmq') is a message-queue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bmq -> z_bmq

framework allowing application developers to use reliable distributed queues.

The 'bmqa' and 'bmqt' packages contain all components that constitute the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bmqa -> z_bmqa
bmqt -> z_bmqt

public API for BlazingmQ users to use. A client should only use the
components in these packages, and should not use any other package under the
'bmq' package group since they are implementation components that may change
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bmq -> z_bmq

at any time.

/Hierarchical Synopsis
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the rest of the document to reflect z_bmq accurately as well

/---------------------
The 'bmq' group library currently has 5 packages forming 5 levels of physical
dependency.
..
5. bmqa

4. bmqimp

3. bmqp

2. bmqt

1. bmqscm
..

/Package Synopsis
/------------------
: 'bmqa':
: Provide applications public API for the BlazingmQ SDK.
:
: 'bmqimp':
: [INTERNAL] Provide implementation for the API of the BlazingMQ SDK.
:
: 'bmqp':
: [INTERNAL] Provide BlazingMQ protocol definition, builders and parsers.
:
: 'bmqscm':
: Provide versioning information for library components in 'bmq'.
:
: 'bmqt':
: Provide value-semantic vocabulary types.

/Package Overview
/----------------
The following provides a brief overview of several of the packages within the
'bmq' package group, arranged in alphabetical order. The descriptions here
are still very brief; see the respective Package Level documents for more
details and usage examples.

/'bmqa'
/- - -
'bmqa' provides the top-level public APIs application can use to interact with
BlazingMQ framework in their applications.

/'bmqt'
/- - -
'bmqt' provides value-semantic vocabulary types used in the {'bmqa'} APIs.
5 changes: 5 additions & 0 deletions src/groups/wrappers/z_bmq/group/z_bmq.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Level 2
bmq

# Level 1
bsl
4 changes: 4 additions & 0 deletions src/groups/wrappers/z_bmq/group/z_bmq.mem
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# [OFFLINE ONLY]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the meaning of [OFFLINE ONLY]?


z_bmqa
z_bmqt
1 change: 1 addition & 0 deletions src/groups/wrappers/z_bmq/group/z_bmq.t.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mwc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

1 change: 1 addition & 0 deletions src/groups/wrappers/z_bmq/z_bmqa/package/z_bmqa.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z_bmqt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

13 changes: 13 additions & 0 deletions src/groups/wrappers/z_bmq/z_bmqa/package/z_bmqa.mem
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
z_bmqa_configurequeuestatus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort the components in alphabetical order

z_bmqa_confirmeventbuilder
z_bmqa_closequeuestatus
z_bmqa_event
z_bmqa_message
z_bmqa_messageevent
z_bmqa_messageeventbuilder
z_bmqa_messageiterator
z_bmqa_messageproperties
z_bmqa_queueid
z_bmqa_session
z_bmqa_sessionevent
z_bmqa_openqueuestatus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

99 changes: 99 additions & 0 deletions src/groups/wrappers/z_bmq/z_bmqa/z_bmqa_closequeuestatus.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#include <bmqa_closequeuestatus.h>
#include <z_bmqa_closequeuestatus.h>
Comment on lines +1 to +2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <bmqa_closequeuestatus.h>
#include <z_bmqa_closequeuestatus.h>
#include <z_bmqa_closequeuestatus.h>
#include <bmqa_closequeuestatus.h>

Please put the header of the component as the first include


int z_bmqa_CloseQueueStatus__delete(z_bmqa_CloseQueueStatus** closeQueueStatus)
{
using namespace BloombergLP;

BSLS_ASSERT(closeQueueStatus != NULL);

bmqa::CloseQueueStatus* status_p =
reinterpret_cast<bmqa::CloseQueueStatus*>(*closeQueueStatus);
delete status_p;
*closeQueueStatus = NULL;

return 0;
}

int z_bmqa_CloseQueueStatus__create(z_bmqa_CloseQueueStatus** closeQueueStatus)
{
using namespace BloombergLP;

bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus();

*closeQueueStatus = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p);

return 0;
}

int z_bmqa_CloseQueueStatus__createCopy(z_bmqa_CloseQueueStatus** closeQueueStatus,
const z_bmqa_CloseQueueStatus* other)
{
using namespace BloombergLP;

const bmqa::CloseQueueStatus* other_p =
reinterpret_cast<const bmqa::CloseQueueStatus*>(other);
bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus(*other_p);

*closeQueueStatus = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p);

return 0;
}

int z_bmqa_CloseQueueStatus__createFull(z_bmqa_CloseQueueStatus** closeQueueStatus,
const z_bmqa_QueueId* queueId,
int result,
const char* errorDescription)
{
using namespace BloombergLP;

const bmqa::QueueId* queueId_p = reinterpret_cast<const bmqa::QueueId*>(
queueId);
const bsl::string errorDescription_str(errorDescription);
bmqt::CloseQueueResult::Enum result_enum =
static_cast<bmqt::CloseQueueResult::Enum>(result);
bmqa::CloseQueueStatus* status_p = new bmqa::CloseQueueStatus(
*queueId_p,
result_enum,
errorDescription_str);
*closeQueueStatus = reinterpret_cast<z_bmqa_CloseQueueStatus*>(status_p);

return 0;
}

bool z_bmqa_CloseQueueStatus__toBool(const z_bmqa_CloseQueueStatus* closeQueueStatus)
{
using namespace BloombergLP;
const bmqa::CloseQueueStatus* status_p =
reinterpret_cast<const bmqa::CloseQueueStatus*>(closeQueueStatus);
return *status_p;
}

int z_bmqa_CloseQueueStatus__queueId(const z_bmqa_CloseQueueStatus* closeQueueStatus,
z_bmqa_QueueId const** queueId_obj)
{
using namespace BloombergLP;
const bmqa::CloseQueueStatus* status_p =
reinterpret_cast<const bmqa::CloseQueueStatus*>(closeQueueStatus);
const bmqa::QueueId* queueId_p = &(status_p->queueId());

*queueId_obj = reinterpret_cast<const z_bmqa_QueueId*>(queueId_p);
return 0;
}

int z_bmqa_CloseQueueStatus__result(const z_bmqa_CloseQueueStatus* closeQueueStatus)
{
using namespace BloombergLP;
const bmqa::CloseQueueStatus* status_p =
reinterpret_cast<const bmqa::CloseQueueStatus*>(closeQueueStatus);
return status_p->result();
}

const char* z_bmqa_CloseQueueStatus__errorDescription(
const z_bmqa_CloseQueueStatus* closeQueueStatus)
{
using namespace BloombergLP;
const bmqa::CloseQueueStatus* status_p =
reinterpret_cast<const bmqa::CloseQueueStatus*>(closeQueueStatus);
return status_p->errorDescription().c_str();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

114 changes: 114 additions & 0 deletions src/groups/wrappers/z_bmq/z_bmqa/z_bmqa_closequeuestatus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#ifndef INCLUDED_Z_BMQA_CLOSEQUEUESTATUS
#define INCLUDED_Z_BMQA_CLOSEQUEUESTATUS

#if defined(__cplusplus)
extern "C" {
#endif

#include <stdbool.h>
#include <z_bmqa_queueid.h>

typedef struct z_bmqa_CloseQueueStatus z_bmqa_CloseQueueStatus;

/**
* @brief Deletes the memory allocated for a pointer to a bmqa::CloseQueueStatus object.
*
* This function deallocates the memory pointed to by the input pointer to a bmqa::CloseQueueStatus object and sets the pointer to NULL.
*
* @param closeQueueStatus A pointer to a pointer to a bmqa::CloseQueueStatus object.
* Upon successful completion, this pointer will be set to NULL.
* @return Returns 0 upon successful deletion.
*/
int z_bmqa_CloseQueueStatus__delete(z_bmqa_CloseQueueStatus** closeQueueStatus);

/**
* @brief Creates a new bmqa::CloseQueueStatus object.
*
* This function creates a new bmqa::CloseQueueStatus object and assigns its pointer to the provided pointer.
*
* @param closeQueueStatus A pointer to a pointer to a bmqa::CloseQueueStatus object.
* Upon successful completion, this pointer will hold the newly created CloseQueueStatus object.
* @return Returns 0 upon successful creation.
*/
int z_bmqa_CloseQueueStatus__create(z_bmqa_CloseQueueStatus** closeQueueStatus);

/**
* @brief Creates a copy of a bmqa::CloseQueueStatus object.
*
* This function creates a copy of the specified bmqa::CloseQueueStatus object and assigns its pointer to the provided pointer.
*
* @param closeQueueStatus A pointer to a pointer to a bmqa::CloseQueueStatus object.
* Upon successful completion, this pointer will hold the newly created copy of the CloseQueueStatus object.
* @param other A pointer to a constant bmqa::CloseQueueStatus object to copy.
* @return Returns 0 upon successful creation.
*/
int z_bmqa_CloseQueueStatus__createCopy(z_bmqa_CloseQueueStatus** closeQueueStatus,
const z_bmqa_CloseQueueStatus* other);

/**
* @brief Creates a bmqa::CloseQueueStatus object with specified parameters.
*
* This function creates a new bmqa::CloseQueueStatus object with the specified parameters and assigns its pointer to the provided pointer.
*
* @param closeQueueStatus A pointer to a pointer to a bmqa::CloseQueueStatus object.
* Upon successful completion, this pointer will hold the newly created CloseQueueStatus object.
* @param queueId A pointer to a constant z_bmqa_QueueId object representing the queue identifier.
* @param result An integer representing the result of the close operation.
* @param errorDescription A pointer to a constant character string representing the error description.
* @return Returns 0 upon successful creation.
*/
int z_bmqa_CloseQueueStatus__createFull(z_bmqa_CloseQueueStatus** closeQueueStatus,
const z_bmqa_QueueId* queueId,
int result,
const char* errorDescription);

/**
* @brief Converts a CloseQueueStatus object to a boolean value.
*
* This function converts the specified CloseQueueStatus object to a boolean value.
*
* @param closeQueueStatus A pointer to a constant z_bmqa_CloseQueueStatus object to convert.
* @return Returns true if the CloseQueueStatus object indicates success, false otherwise.
*/
bool z_bmqa_CloseQueueStatus__toBool(
const z_bmqa_CloseQueueStatus* closeQueueStatus);

/**
* @brief Retrieves the queue identifier from a CloseQueueStatus object.
*
* This function retrieves the queue identifier from the specified CloseQueueStatus object.
*
* @param closeQueueStatus A pointer to a constant z_bmqa_CloseQueueStatus object.
* @param queueId_obj A pointer to a pointer to a constant z_bmqa_QueueId object.
* Upon successful completion, this pointer will hold the queue identifier.
* @return Returns 0 upon successful retrieval of the queue identifier.
*/
int z_bmqa_CloseQueueStatus__queueId(const z_bmqa_CloseQueueStatus* closeQueueStatus,
z_bmqa_QueueId const** queueId_obj);

/**
* @brief Retrieves the result of a close queue operation from a CloseQueueStatus object.
*
* This function retrieves the result of the close queue operation from the specified CloseQueueStatus object.
*
* @param closeQueueStatus A pointer to a constant z_bmqa_CloseQueueStatus object.
* @return Returns an integer representing the result of the close queue operation.
*/
int z_bmqa_CloseQueueStatus__result(const z_bmqa_CloseQueueStatus* closeQueueStatus);

/**
* @brief Retrieves the error description from a CloseQueueStatus object.
*
* This function retrieves the error description from the specified CloseQueueStatus object.
*
* @param closeQueueStatus A pointer to a constant z_bmqa_CloseQueueStatus object.
* @return Returns a pointer to a constant character string representing the error description.
*/
const char* z_bmqa_CloseQueueStatus__errorDescription(
const z_bmqa_CloseQueueStatus* closeQueueStatus);

#if defined(__cplusplus)
}
#endif

#endif
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at end of file

Loading