diff --git a/ballerina/constants.bal b/ballerina/constants.bal index c5308c4..c60cdeb 100644 --- a/ballerina/constants.bal +++ b/ballerina/constants.bal @@ -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 = " "; diff --git a/ballerina/tests/queue_producer_consumer_tests.bal b/ballerina/tests/queue_producer_consumer_tests.bal index 00096e0..93bcd36 100644 --- a/ballerina/tests/queue_producer_consumer_tests.bal +++ b/ballerina/tests/queue_producer_consumer_tests.bal @@ -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); @@ -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, diff --git a/ballerina/types.bal b/ballerina/types.bal index bc82395..7b2a751 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -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 @@ -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?; diff --git a/docs/spec/spec.md b/docs/spec/spec.md index 1860490..8e47464 100644 --- a/docs/spec/spec.md +++ b/docs/spec/spec.md @@ -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.