ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Could I send a JMS BytesMessage using C API?

Post new topic  Reply to topic
 Could I send a JMS BytesMessage using C API? « View previous topic :: View next topic » 
Author Message
ioat
PostPosted: Wed Oct 08, 2008 10:05 pm    Post subject: Could I send a JMS BytesMessage using C API? Reply with quote

Acolyte

Joined: 18 Jul 2005
Posts: 53

I need to using C API to send a JMS BytesMessage, is it possible?
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Thu Oct 09, 2008 2:26 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

So long as you don't need an RFH2 with JMS properties, just set the message format in the MQMD to MQFMT_NONE.

Most JMS applications are tolerant of messages without RFH2.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
ioat
PostPosted: Thu Oct 09, 2008 6:14 pm    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2005
Posts: 53

It works well, thanks a lot.
Back to top
View user's profile Send private message
ioat
PostPosted: Thu Oct 09, 2008 6:21 pm    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2005
Posts: 53

If I want to receive the JMS message (like TextMessage, BytesMessage and MapMessage) from C, is the only way to parse the received string myself?

eg: for MapMessage, I'll receive a xml string from C, then parse the xml myself.

Is there any other better way?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Oct 09, 2008 6:28 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

ioat wrote:
If I want to receive the JMS message (like TextMessage, BytesMessage and MapMessage) from C, is the only way to parse the received string myself?

eg: for MapMessage, I'll receive a xml string from C, then parse the xml myself.

Is there any other better way?

Read up in the using Java manual where the mapping of base MQ to JMS MQ is described.

To get a TextMessage just set the format to MQFMT_STRING.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ioat
PostPosted: Thu Oct 09, 2008 6:40 pm    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2005
Posts: 53

I use the JMS to send the TextMessage, but received below from C:

RFH ? 3MQSTR ¸ <mcd><Msd>jms_text</Msd></mcd> L<jms><Dst>queue:///PTEST.Q1</Dst><Tms>1223452199596</Tms><Dlv>2</Dlv></jms> test TextMessage
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Oct 09, 2008 7:00 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

ioat wrote:
I use the JMS to send the TextMessage, but received below from C:

RFH ? 3MQSTR ¸ <mcd><Msd>jms_text</Msd></mcd> L<jms><Dst>queue:///PTEST.Q1</Dst><Tms>1223452199596</Tms><Dlv>2</Dlv></jms> test TextMessage

What you have is an RFH header. Set your JNDI to target client MQ or your uri as "queue://QMGR/QUEUE?targetClient=1". This will suppress the RFH header.

Note: you could also use the XMS support pack which gives you a JMS like interface in non java languages.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
ioat
PostPosted: Thu Oct 09, 2008 7:04 pm    Post subject: Reply with quote

Acolyte

Joined: 18 Jul 2005
Posts: 53

I couldn't change the target client option. I want to code a MQ utility tool using C, to browse/receive the message from queue.

But the queue maybe only used for Java application, don't need to change the target client option.

Not formiliar with XMS, could it receive the JMS message directly?

The bad way is to parse the received message myself.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Oct 11, 2008 6:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

XMS will behave like JMS for you. Read up on the support pack documentation. Search the support pack with message service.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Could I send a JMS BytesMessage using C API?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.