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

Introduce missing MQMD fields to the ibmmq:Message #56

Merged
merged 24 commits into from
Sep 5, 2024

Conversation

ayeshLK
Copy link
Member

@ayeshLK ayeshLK commented Sep 4, 2024

Purpose

$subject

Fixes: #6964
Related to: #775

Examples

Using userId and accountingToken

// Open the Queue/Topic with `ibmmq:MQOO_SET_IDENTITY_CONTEXT` option enabled
Queue queue = check queueManager.accessQueue("DEV.QUEUE.1", .... | ibmmq:MQOO_SET_IDENTITY_CONTEXT);

string accountingToken = "<accounting-token>";
string userId = "<userId>";
check queue->put({
    accountingToken: accountingToken.toBytes(),
    userId,
    payload: "Hello world!".toBytes()
}, options = ibmmq:MQPMO_SET_IDENTITY_CONTEXT);

Using encoding and characterSet

json messageBody = {
    user: "Doe, John",
     id: 1234,
     description: "Regular application developer"
};
byte[] payload = messageBody.toJsonString().toBytes();
check queue->put({
    characterSet: ibmmq:MQCCSI_UTF8,
    encoding: ibmmq:MQENC_INTEGER_NORMAL,
    payload
});

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@ayeshLK ayeshLK marked this pull request as draft September 4, 2024 13:23
@ayeshLK ayeshLK marked this pull request as ready for review September 5, 2024 05:42
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.21%. Comparing base (d4abacf) to head (df544d3).
Report is 88 commits behind head on main.

Files with missing lines Patch % Lines
...n/java/io/ballerina/lib/ibm.ibmmq/CommonUtils.java 71.42% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #56      +/-   ##
============================================
- Coverage     81.21%   80.21%   -1.00%     
- Complexity      104      121      +17     
============================================
  Files            20       20              
  Lines           958      935      -23     
  Branches         80       92      +12     
============================================
- Hits            778      750      -28     
- Misses          157      158       +1     
- Partials         23       27       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

MohamedSabthar
MohamedSabthar previously approved these changes Sep 5, 2024
Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

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

LGTM

@ayeshLK ayeshLK merged commit 78ce0da into ballerina-platform:main Sep 5, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce missing MQMD fields to the ibmmq:Message
3 participants