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 Java / JMS » Message Data Length

Post new topic  Reply to topic
 Message Data Length « View previous topic :: View next topic » 
Author Message
marcos.sousa
PostPosted: Wed Dec 30, 2009 11:22 am    Post subject: Message Data Length Reply with quote

Newbie

Joined: 30 Dec 2009
Posts: 2

When I use spring JMS
JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsQueueTemplate");
jmsTemplate.convertAndSend("QUEUE_1", "abc");

The string abc is data lenght is 159.

But using direct put on the queue or the code:
MQMessage msg = new MQMessage();
msg.format = CMQC.MQFMT_STRING;
msg.characterSet = 1208;
msg.encoding = 546;
msg.writeString("abc");
queue.put(msg);

The string abc is data lenght is 3.

How can I get data length 3 with JMS?
Back to top
View user's profile Send private message
marcos.sousa
PostPosted: Wed Dec 30, 2009 1:08 pm    Post subject: Solution Reply with quote

Newbie

Joined: 30 Dec 2009
Posts: 2

I found the answer in this link http://forum.springsource.org/showthread.php?t=41968&highlight=websphere

<bean id="jmsQueueConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
...
</bean>

<bean id="jmsSpringConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory102">
...
</bean>

<bean id="jmsQueueTemplate" class="org.springframework.jms.core.JmsTemplate102">
...
</bean>

<bean id="queue" class="com.ibm.mq.jms.MQQueue" depends-on="jmsQueueConnectionFactory">
<property name="baseQueueName" value="QUEUE_NAME" />
<property name="targetClient" value="1" />
</bean>


==============
import com.ibm.mq.jms.MQQueue;

@Autowired
@Qualifier("queue")
protected MQQueue queue;

this.jmsTemplate.convertAndSend(this.queue, "abc");
==============
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Message Data Length
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.