After checking out mq series docs and white paper I have got the architecture for MQ messages ie Message descriptor (Message header)
Application data (Message body) and its details here
But I want to know what is the format (xml,binary,text...) in which quemanager of MQ series stores the messages.
The format of the payload is decided by the application, not MQ. You can send messages in whatever format you want. As mentioned in the developersWorks article, MQ has some predefined formats such MQFMT_STRING which means the format of the payload is text. This format is typically used for XML, text message body. These are the predefined list of message formats.
Related
Is it possible to do content-based filter with JMS?
IBM MQ publish/subscribe seem to allow content-base filtering
https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13460_.htm
https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/bq13360_.htm
I've tried to find a way with my JMSListener to filter on a Body elment but I couldn't manage to make it work..
IBM MQ can not directly filter based on the body, only based on message properties. IBM states that a extended message selection provider can do message selection based on the message payload, but as far as I know the only extended message selection provider available is ACE/IIB/WMB.
Please review IBM Knowledge Center page IBM MQ 9.1.x>IBM MQ>Developing applications>Developing JMS and Java applications>Using IBM MQ classes for JMS>Writing IBM MQ classes for JMS applications>JMS messages>Message selectors in JMS:
A property value might duplicate a value in a message body. JMS does not define a policy for what might be made into a property. However, application developers must be aware that JMS providers probably handle data in a message body more efficiently than data in message properties. For best performance, applications must use message properties only when they need to customize a message header. The primary reason for doing this is to support customized message selection.
A JMS message selector allows a client to specify the messages that it is interested in by using the message header. Only messages with headers that match the selector are delivered.
Message selectors cannot refer to message body values.
A message selector matches a message when the selector evaluates to true when the message header field and property values are substituted for their corresponding identifiers in the selector.
A message selector is a String, with syntax that is based on a subset of the SQL92 conditional expression syntax. The order in which a message selector is evaluated is from left to right within a precedence level. You can use parentheses to change this order. Predefined selector literals and operator names are written here in uppercase; however, they are not case-sensitive.
Please also review IBM Knowledge Center page IBM MQ 9.0.x>IBM MQ>Developing applications>Application development concepts>IBM MQ messages>Selecting messages from queues>Selecting on the content of a message
It is possible to subscribe based on a selection of message payload content (also known as content filtering), but the decision about which messages should be delivered to such a subscription cannot be performed directly by IBM® MQ; instead an extended message selection provider, for example IBM Integration Bus, is required to process the messages.
I want to send a message to an activeMQ and receive it via MQTT.js in the frontend.
jmsTemplate.convertAndSend("topic", "Hello World!");
I am getting the message, but with a header, that I can not decode.
S�A S�)�x-opt-jms-destQ�x-opt-jms-msg-typeQ Ss� f
�/ID:myID#�topic://myTopic####� j��< St�e Sw� Hello World!
Now I am trying to remove the header from my message.
This thread mentions the targetClient property, but this doesn't seam to work with a topic: Spring JMS Template - remove RFH Header information
I also found the MessageBuilder, where I should be able to set an empty header, but this MessageBuilder doesn't work with the jmsTemplate. jmsTemplate only supports the MessageCreator, which doesn't support an empty header.
How can I send a JMS Message in plain text without any header?
Thanks for any suggestions.
Updating the Queue Broker to work with JMS2 fixed this issue.
Let's say there is an attachment in the slack channel . And that attachment has some unique identifier So if I type the identifier i should get the attachment as response in the channel.
Example: if i type 45 and its related to an xml file attached in the slack channel, then it should reply with the uploaded attachment in the conversation.
I tried using GET method for https://slack.com/api/channels.history?&channel=<>&count=1&pretty=1&inclusive=true&token=<> and I obtained the history of the conversation in the channel.
Don't know how timestamp and unfurl can help in achieving this.
The API method channels.history returns a list of messages from a specific channel as a big JSON array. It will only return the 100 latest by default and you have to use paging if your channel contains more messages.
Messages are referenced by timestamp (ts). Attachments are elements of its message and references by ID (id), which represents the order their are shown on Slack.
So to access a specific attachment you first need to find the correct message by its timestamp and then you can find the attachment by its ID.
If you know the timestamp of the message you are interested in you can include latest=timestamp and oldest=timestamp in your API call to receive only that message.
If you do not know the timestamp of the message you will have to retrieve all messages within a reasonable timeframe and then detect your message based on some other criteria.
Btw. I would consider switching to conversations.history, which is the new and recommend API method for retrieving messages from all type of channels.
I am subscribed to AMQ. I am trying to receive and store specific messages as they come across the wire. Some of the message that I am receiving have garbage values in body and when I perform the toString() after casting to a TextMessage the text is null. The error that I received is a UTF exception. I fully expect the message to fail the .getText(). Is there a way in Message to get the text without having to validate the xml or validate the that it is UTF?
Thanks
I'm trying to understand why serialized objects are being stripped out when received.
Here is the general layout :
1. Produce JMS messages and send to a topic on an external ActiveMQ broker. The code is based off the Spring boot JMS message and can be viewed at http://bit.ly/QECQ21 . In my example, I generate various types of messages (text , POJO, Map)
2. I have 2 JMS consumers that subscribe to this topic.
a. One is a java client. This client correctly identifies all the various message types.
b. The 2nd client is a javascript client based on websockets + stomp.js . This correctly identifies text messages but not messages that contain POJOs generated by my producer.
Here is the sample output from the web client (source at http://bit.ly/Od0noF ) .
What am I doing wrong? Something wrong with the the addressing or something else in the code? Something about the way I'm using (or misusing) STOMP? I had to use "tcp://localhost:61616" in the Application.java class to correctly contact the broker.
Thanks
MESSAGE priority:4 persistent:true subscription:sub-0 expires:0 timestamp:1396418227090 destination:/topic/greetings message-id:ID:blackbox-53461-1396418226684-1:1:2:1:1 content-length:4 ping
Body:ping
MESSAGE priority:4 persistent:true subscription:sub-0 expires:0 timestamp:1396418227117 destination:/topic/greetings message-id:ID:blackbox-53461-1396418226684-1:1:2:1:2
Body: ======> missing body
MESSAGE priority:4 persistent:true subscription:sub-0 expires:0 timestamp:1396418227122 destination:/topic/greetings message-id:ID:blackbox-53461-1396418226684-1:1:2:1:3
Body: ======> missing body
MESSAGE priority:4 persistent:true subscription:sub-0 expires:0 timestamp:1396418227125 destination:/topic/greetings message-id:ID:blackbox-53461-1396418226684-1:1:2:1:4 content-length:5 close
Body:close
No answers yet so I'll add my findings. STOMP is a text based protocol and as such the body needs to be converted to a text format (such as JSON). In my case, this can be done using the spring websockets framework (which internally uses Jackson) or by explicitly coding the object into JSON using Jackson and them transmitting as a text message