This content has been marked as final.
Show 2 replies
-
1. Re: Acessing Websphere MQ from standalone application
igor.beslic Aug 7, 2009 12:55 PM (in response to amagno)Hi!
you have to:
0. Include MQ libraries in your project (extract them from adapter).
1. Create and configure MQQueueManager object.
2. Configure MQMessage
3. Configure message options
4. use MQQueueManagers put method to send message.
this is my example of topic publishing:MQQueueManager mqqueuemanager = getActiveMQManager();//returns preconfigured cashed manager MQMessage mqmessage = new MQMessage(); mqmessage.format = MQC.MQFMT_STRING; mqmessage.persistence = CMQC.MQPER_PERSISTENT; mqmessage.expiry = -1; mqmessage.write(getMyTxtMessage().getBytes("UTF-8")); mqmessage.characterSet = 1208; MQPutMessageOptions options = new MQPutMessageOptions(); options.options += CMQC.MQPMO_RETAIN; mqqueuemanager.put(CMQC.MQOT_TOPIC, "", queueManagerOut, topic, mqmessage, options); messageparams.setMessageId(mqmessage.messageId);
I'm not sure but there should be some examples on Internet... -
2. Re: Acessing Websphere MQ from standalone application
vickyk Sep 11, 2009 7:53 AM (in response to amagno)"Alphonsus" wrote:
I've configured WSMQ jca connection in a JBossAS and it's working allright. Now I'm trying to use it from a standalone application and can't figure how.
Can anyone please help?
Couple of ways
1) configre <use-java-context> true and then get the related ConnectionFactories from the InitialContext. i.e <use-java-context>true</use-java-context>
2) Have a stateless EJB at the server side which will talk to JCA adapter deployed in Jboss.