Skip to content

Commit

Permalink
Restructure the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ayeshLK committed Sep 5, 2024
1 parent 9eb87b4 commit df544d3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 20 deletions.
24 changes: 12 additions & 12 deletions ballerina/constants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -126,41 +126,41 @@ public const int MQENC_FLOAT_IEEE_REVERSED = 512;
public const int MQENC_FLOAT_S390 = 768;

# Coded Character Set Identifiers - Appl.
public const int CCSI_APPL = -3;
public const int MQCCSI_APPL = -3;

# ASCII codeset
public const int CCSI_ASCII = 850;
public const int MQCCSI_ASCII = 850;

# ISO standard ASCII codeset
public const int CCSI_ASCII_ISO = 819;
public const int MQCCSI_ASCII_ISO = 819;

# Coded Character Set Identifiers - As Published.
public const int CCSI_AS_PUBLISHED = -4;
public const int MQCCSI_AS_PUBLISHED = -4;

# The CodedCharSetId of the data in the String field is defined by the CodedCharSetId field in the header structure
# that precedes the MQCFH structure, or by the CodedCharSetId field in the MQMD if the MQCFH is at the start of the message.
public const int CCSI_DEFAULT = 0;
public const int MQCCSI_DEFAULT = 0;

# The American EBCDIC codeset
public const int CCSI_EBCDIC = 37;
public const int MQCCSI_EBCDIC = 37;

# Coded Character Set Identifiers - Embedded.
public const int CCSI_EMBEDDED = -1;
public const int MQCCSI_EMBEDDED = -1;

# Character data in the message is in the same character set as this structure.
public const int CCSI_INHERIT = -2;
public const int MQCCSI_INHERIT = -2;

# Character data in the message is in the queue manager's character set.
public const int CCSI_Q_MGR = 0;
public const int MQCCSI_Q_MGR = 0;

# Coded Character Set Identifiers - Undefined.
public const int CCSI_UNDEFINED = 0;
public const int MQCCSI_UNDEFINED = 0;

# Unicode codeset
public const int CCSI_UNICODE = 1200;
public const int MQCCSI_UNICODE = 1200;

# UTF-8 codeset
public const int CCSI_UTF8 = 1208;
public const int MQCCSI_UTF8 = 1208;

const string DEFAULT_BLANK_VALUE = " ";

Expand Down
5 changes: 2 additions & 3 deletions ballerina/tests/queue_producer_consumer_tests.bal
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,7 @@ function produceMessagesWithIdentification() returns error? {
string userId = "user-1";
check queue->put({
accountingToken: accountingToken.toBytes(),
persistence: 1,
userId: userId,
userId,
payload: messageContent.toBytes()
}, MQPMO_SET_IDENTITY_CONTEXT);

Expand Down Expand Up @@ -567,7 +566,7 @@ function produceMessagesWithCharacterSet() returns error? {
userID = "app", password = "password");
Queue queue = check queueManager.accessQueue("DEV.QUEUE.1", MQOO_OUTPUT | MQOO_INPUT_AS_Q_DEF);

MessageCharset characterSet = CCSI_UTF8;
MessageCharset characterSet = MQCCSI_UTF8;
string messageContent = "This is a sample UTF-8 charset based message";
check queue->put({
characterSet,
Expand Down
6 changes: 3 additions & 3 deletions ballerina/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public type OPEN_TOPIC_OPTION OPEN_AS_SUBSCRIPTION|OPEN_AS_PUBLICATION;
public type Header MQRFH2|MQRFH|MQCIH|MQIIH;

# The coded character set used in application message data.
public type MessageCharset CCSI_APPL|CCSI_ASCII|CCSI_ASCII_ISO|CCSI_AS_PUBLISHED|CCSI_DEFAULT|
CCSI_EBCDIC|CCSI_EMBEDDED|CCSI_INHERIT|CCSI_Q_MGR|CCSI_UNDEFINED|CCSI_UNICODE|CCSI_UTF8;
public type MessageCharset MQCCSI_APPL|MQCCSI_ASCII|MQCCSI_ASCII_ISO|MQCCSI_AS_PUBLISHED|MQCCSI_DEFAULT|
MQCCSI_EBCDIC|MQCCSI_EMBEDDED|MQCCSI_INHERIT|MQCCSI_Q_MGR|MQCCSI_UNDEFINED|MQCCSI_UNICODE|MQCCSI_UTF8;

# The SSL Cipher Suite to be used for secure communication with the IBM MQ server.
public type SslCipherSuite SSL_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA|SSL_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
Expand Down Expand Up @@ -145,7 +145,7 @@ public type Message record {|
string replyToQueueName?;
string replyToQueueManagerName?;
int encoding = MQENC_INTEGER_NORMAL|MQENC_DECIMAL_NORMAL|MQENC_FLOAT_IEEE_NORMAL;
MessageCharset characterSet = CCSI_Q_MGR;
MessageCharset characterSet = MQCCSI_Q_MGR;
byte[] accountingToken?;
string userId?;
Header[] headers?;
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ public type Header MQRFH2|MQRFH|MQCIH|MQIIH;
- MessageCharset type represents coded character set used in application message data.

```ballerina
public type MessageCharset CCSI_APPL|CCSI_ASCII|CCSI_ASCII_ISO|CCSI_AS_PUBLISHED|CCSI_DEFAULT|
CCSI_EBCDIC|CCSI_EMBEDDED|CCSI_INHERIT|CCSI_Q_MGR|CCSI_UNDEFINED|CCSI_UNICODE|CCSI_UTF8;
public type MessageCharset MQCCSI_APPL|MQCCSI_ASCII|MQCCSI_ASCII_ISO|MQCCSI_AS_PUBLISHED|MQCCSI_DEFAULT|
MQCCSI_EBCDIC|MQCCSI_EMBEDDED|MQCCSI_INHERIT|MQCCSI_Q_MGR|MQCCSI_UNDEFINED|MQCCSI_UNICODE|MQCCSI_UTF8;
```

- Message record represents an IBM MQ message.
Expand Down

0 comments on commit df544d3

Please sign in to comment.