I am developing an application which sends message to MQ Queuemanager using XMS.Net. One of the requirement is to set custom RFH2 value . I am unable to figure this out.
How do we set RFH2 for IMessage using XMS.net ? I can see this can be easily done using MQ native api
Are you trying to set a custom/user property? If so, you can do that using SetXXXXProperty (where XXX denotes data type) method of Message class. For example
ITextMessage textMessage = session.CreateTextMessage("Message with custom properties");
textMessage.SetStringProperty("Country", "UK");
textMessage.SetStringProperty("State", "Hampshire");
textMessage.SetIntProperty("Phone", 123345);
UPDATE
XMS .NET is JMS specification implementation while RFH is MQ specific. Although XMS internally uses RFH2 headers, it does not provide a way for applications to add RFH properties.
You may want to look at Base .NET classes (amqmdnet.dll) and code the required RFH folders to message.
Related
We have existing application in JAVA which uses com.ibm.mq.jms.MQQueue to send MQ messages to IBM Mainframe CICS application.
How to get the Triggertype in Java?
The MQSeries MQ Trigger type is set to "NONE" for Batch processing during night for 30 mins. We want to check the triggertype in Java Application and display appropriate error message to user.
Please let me know how to get the Trigger type in JAVA.
MQQueue - getTriggerType method is available for com.ibm.mq.MQQueue and not available for com.ibm.mq.jms.MQQueue
Thanks
Please let me know how to get the Trigger type in JAVA. MQQueue -
getTriggerType method is available for com.ibm.mq.MQQueue and not
available for com.ibm.mq.jms.MQQueue
True. The JMS specification does not support the method because it is an IBM MQ only method. You need to use the MQ classes for Java (and not JMS).
I am new to Tibco, ActiveMatrix BusinessWorks and Tibco Designer.
I followed the Tutorial of Jazon Samillano regarding sending and receiving JMS Messages. In this tutorial he sends a Text within the JMS Body to the Queue.
What I am now trying is to send a Java-Object via another Java-Application to the Queue and read the Java-Object within Tibco Designer with the Palette-Element JMS Queue Receiver. After that I want to process the data and then send a JMS Message to another Queue with the same Object (with some slight manipulations) via a JMS Queue Sender.
In the configuration of the JMS Queue Receiver and of the JMS Queue Sender there is a Dropdown List where I can chose the Message Type "Object". But what do I have to do then. I think I need to make a mapping between the JMS Body to a variable (= the reprasentation of the Java Object in Tibco Designer) to process the data. But how can I do this?
Does anyone knows a good tutorial or can anyone explain how I can do this?
I would really really appreciate your help.
Thanks in advance
What you have received is serialized java objects via JMS. You can use the Java Palettes Activity to deserialize it and do whatever you want to do with that object. If your serialized object not from standard Java class (e.g. String) then you need to have the java class or jar in the class path of designer.
I am trying to send jms message with JMeter (Publisher or Point-to-point), but I am not able to send JMSType.
If I put it to JMS properties with name JMSType it finishes with error:
Response message: The property name 'JMSType' is illegal since it starts with JMS
By default Jmeter does not include any JMS implementation jars in its distribution. This must be downloaded from the JMS provider and put in the lib directory of Jmeter.
I have tested this in Jmeter 2.9 and 2.13. You can set JMS header properties including JMSType in the JMS properties tab and publish a message successfully without any errors.
So the answer is no it is not possible. I've changed it in jMeter sources for me. It is probably specific for queue vendors. Any of them allow setting properties as text property the others requires to set it directly to message as there is the JMSType parameter and when you try to set the string 'JMS*' parameter tou got exception.
In weblogic it is possible to create a message bridge between two JMS message queues. While configuring this bridge, a message filter can be applied so that the bridge will route messages that match the filter only.
Is it possible to achieve the same with Websphere?
Specifically I'm trying to achieve this scenario.
I have one source queue on which messages are received. Each message will have a custom JMS property set up. I would like to forward the messages on the source queue, to separate queues based on the JMS property and its value. This is easily configured in WLS using message bridges with filtering. How can I do the same in WAS?
Thanks
Savio
You need to use SIB Mediation.
The WAS info center have an example called writing a routing mediation which seems like what you need.
At the bottom of the example there is a link to what to do next which also explains how to configure WAS to use that mediation.
Without writing custom code (as per your comment on Aviram's answer), it is not possible to achieve the exact same thing, but nonetheless it is possible to achieve same effect;
You say that a 'source queue' distributes messages to other 'separate queues' according to a custom JMS property. I'm assume that you have MDBs (message driven beans) configured to process messages in these separate queues.
What you can do with WebSphere is distribute messages to these MDBs directly from the 'source queue', without having to filter/distribute them to separate queues.
This is managed by using JMS Message Selectors. You can point all your MDBs to the source queue using activation specification definitions, and for each (one for each type of message) MDB, define a JMS Message Selector that matches the ones you use in WLS. This way each message is only delivered the MDB whose filter matches the message's properties. This effectively filters/distributes messages to different MDB's as in WLS.
You may read details on configuring message selectors (during development in RAD, or at/after deploy time) at infocenter. Below is a quote to give you an idea about what it look like;
messageSelector
This attribute determines the JMS message selector
that is used to select which messages the message-driven bean
receives. For example:
JMSType='car' AND color='blue' AND weight>2500
The selector string can refer to fields in the JMS message header and
fields in the message properties. Message selectors cannot reference
message body values.
For the record, we finally ended up writing our own routing algorithm within the application to ensure that messages are sent to separate queues for each client. This way we are independent of app server implementations and the integration effort is the same across app servers, viz., adding custom queues per integrating client.
In brief, We published a JMS custom property that must be set. Using a published convention, we look up for a queue and send responses to the queue. If the property is not set, a default queue is created to route all messages. If the property is set, and the queue cannot be found an exception is raised and processing halted.
This suited our purpose. Hope it helps...
When sending (InOnly) JMS messages with Apache Camel, can I read back the different JMS headers that might have been set automatically on the message, when it was sent?
from("foo:bar")
.to(ExchangePattern.InOnly,"jms:queue:whatever")
.log("msg id set = ${in.header.JMSMessageId}");
I just can't figure out how to send the message "one way" but keeping the sent JMS message as "in" message in the route afterwards.
Background:
I know that I can present some values, but it would be easier if they where set by the actual JMS implementation. For instance, in this case, I want to work with WebSphere SIBus, WebSphere MQ and ActiveMQ. It's best to rely on WebSphere MQs internal message id format, because it will only index certain message formats. It might be similar aspects on the WebSphere SIBus implementation.
This feature is available starting at 2.10.3 and 2.11.0.