get_messages/4 is an Erlang function exported by "imq" module. Retrieves messages from a queue in more controlled way. Take into consideration that the messages are organized in FIFO data model which reflects how records are managed and retrieved from the queues. The following message properties are available: •{message_count, integer()} - 0 = extract all messages, or grater to limit the maximum number of extracted messages. •{message_purge, boolean()} - false = do not purge on extraction (acts by default, i.e. keep it into the queue), or true = purge message from queue on extraction. •{message_data_limit, integer()} - specifies the maximum number of bytes to be read per messages. •{message_id, stirng()} - filer by message ID •{message_correlation, string()} - filter by message correlation ID Each messages from the returned list has a unified format as the following tuple: {message, Fields}. Each fields has is also in a tuple notation as {Name, Value}. We are supporting quite many fields provided by the IBM MQ Client API, and most likely the list of supported fields shall be extended in time. However, here we will mention only few of them for better clarity and understanding how to use this plug-in: •{message_data, binary()} - contains the message content •{message_id, binary()} - this unique byte-sequence is generated by IBM MQ as a message identifier. Yes, it looks strange for an ID but this is the case. •{date_time, string()} - registration time-stamp in ISO8601 format of the current message. •{reply_manager_name, string()} - name of the Reply manager. •{reply_queue_name, string()} - name of the Reply queue. •{character_set, integer()} and {encoding, integer()} - two important fields that need to be considered when the message_data has to be decoded. •{format, string()} - this field specifies how the MQ manager stores the message data. The value of the format depends on couple of rules and conditions. So, you should refer the IBM documentation for more details. Nevertheless, here we will mention few important formats: o" " - yes, this is a string with 8 spaces. IBM MQ is using this to specify a BINARY or BLOB data; o"MQSTR" - the message data contains text or stream - single-byte or double-byte character set. o"MQIMS" - the message data begins with the IMS™ information header. o"MQIMSVS" - the message data is stored in IMS™ variable string. o"MQAMQP" - the message data contains an AMQP fragment. |
|
|