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 » JMS test message, conversion fail

Post new topic  Reply to topic
 JMS test message, conversion fail « View previous topic :: View next topic » 
Author Message
vbartoni
PostPosted: Tue Oct 07, 2025 12:09 am    Post subject: JMS test message, conversion fail Reply with quote

Newbie

Joined: 06 Oct 2025
Posts: 1

Hello,
I am using Java application running on Linux, reading from IBM.MQ topic, which errors out:

Quote:
Failed to decode TextMessage: JMSCMQ1049: The character set '1208(UTF- Unmappable Action: REPORT, Unmappable Replacement: 63, spaceByte: 32' cannot convert some or all of the string '[B@d9f90b'


CCSID IBM278 is used on IBM MQ side.

My application is outputting some information from the JMS message:
Quote:

message.getClass()) -> com.ibm.jms.JMSTextMessage

message.getStringProperty(WMQConstants.JMS_IBM_CHARACTER_SET));
->UTF-8

message.getIntProperty("JMS_IBM_Encoding"); -> 273

message.getStringProperty("JMS_IBM_Format"). -> MQSTR


And here is the code:
Code:


import javax.jms.*;
import com.ibm.msg.client.jms.JmsFactoryFactory;
import com.ibm.msg.client.jms.JmsConnectionFactory;
import com.ibm.msg.client.wmq.WMQConstants;
import com.ibm.jms.JMSMessage;

JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
        JmsConnectionFactory cf = ff.createConnectionFactory();
        cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, host);
        cf.setIntProperty(WMQConstants.WMQ_PORT, port);
        cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
        cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManager);
        cf.setStringProperty(WMQConstants.WMQ_SSL_CIPHER_SUITE, "*TLS12");
cf.setIntProperty(WMQConstants.WMQ_CCSID, 1208);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
        cf.setStringProperty(WMQConstants.WMQ_APPLICATIONNAME, "ReadMQTopicDurable");

Connection connection = cf.createConnection(user, password);
        connection.setClientID(clientId);
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        connection.start();
.
.
Topic topic = session.createTopic(topicString);
MessageConsumer consumer = session.createDurableSubscriber(topic, subscriptionName);
.
.
 Message message = (JMSMessage) consumer.receive(10000);
.
.
 String text = ((TextMessage) message).getText();




I think the code is quite straightforward, and attempting to tell that localal CCSID is 1208.

What is the missing part, should the client somehow tell to IBM MQ manager that conversion has to be done, or there is something to be done configuration of MQ manager?

I think that seeing Message Encoding: 273 (Little-endian integer, z/OS floating point) in the message and character encoding seen as UTF-8 looks wrong, and that some kind of conversion is missing. Maybe message encoding should be Limux/x86 (546) instead of Linux/sparc(273).


[/quote]
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Oct 07, 2025 9:23 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9485
Location: US: west coast, almost. Otherwise, enroute.

Is your data really MQSTR (string)? Or something else?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
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 » JMS test message, conversion fail
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.