i'm new ibm websphere mq server , have few issues when work this. i'm using mqqueueconnectionfactory
send message queue. here code.
mqqueueconnectionfactory connectionfactory = null; queueconnection queueconn = null; queuesession queuesession = null; queuesender queuesender = null; textmessage message = null; try { connectionfactory = new mqqueueconnectionfactory(); connectionfactory.sethostname("192.16.34.45"); connectionfactory.setport(1415); connectionfactory.settransporttype(1); connectionfactory.setqueuemanager("mqsllxq1"); connectionfactory.setchannel("to.mqsllxq1"); queueconn = connectionfactory.createqueueconnection("username", "password"); queuesession = queueconn.createqueuesession(false, session.auto_acknowledge); queuesender = queuesession.createsender(queuesession.createqueue("testqueue")); queuesender.setdeliverymode(deliverymode.persistent); message = queuesession.createtextmessage("test message"); queuesender.send(message); queueconn.close(); } catch (exception je) { je.printstacktrace(); }
the message visible in mq queue jms header.
<mcd><msd>jms_text</msd></mcd> <jms><dst>queue:///testqueue</dst><tms>1454047279356</tms><div>2</div></jms> test message
1) there way avoid jms header , payload in mq queue?
2) there way sync both mq queue , jms queue together?
jms api specification, not wire level protocol specification. different vendors have own way of implementing jms api specification. ibm mq (a.k.a websphere mq) uses rfh2 headers implement jms api.
1) if using jms api receive message, header made available application different message properties. payload can retrieved using message.getbody()
(in mq v8) method. depending on type of message, i.e. text, byte etc, can use gettext(), readbytes()
etc methods retrieve message body.
if receiving application uses mq apis, it's possible strip off message headers changing queue properties.
2) in ibm mq, jms queue points mq queue.
Comments
Post a Comment