|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
JMS test message, conversion fail |
« View previous topic :: View next topic » |
Author |
Message
|
vbartoni |
Posted: Tue Oct 07, 2025 12:09 am Post subject: JMS test message, conversion fail |
|
|
Newbie
Joined: 06 Oct 2025 Posts: 4
|
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 |
|
 |
bruce2359 |
Posted: Tue Oct 07, 2025 9:23 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9486 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 |
|
 |
vbartoni |
Posted: Tue Oct 07, 2025 10:57 pm Post subject: |
|
|
Newbie
Joined: 06 Oct 2025 Posts: 4
|
Data in the message should be string/json. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Oct 08, 2025 7:02 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9486 Location: US: west coast, almost. Otherwise, enroute.
|
vbartoni wrote: |
Data in the message should be string/json. |
I believe you that it should be string, but the error message says it isn't. _________________ 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 |
|
 |
RogerLacroix |
Posted: Wed Oct 08, 2025 12:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3265 Location: London, ON Canada
|
|
Back to top |
|
 |
vbartoni |
Posted: Wed Oct 08, 2025 10:11 pm Post subject: |
|
|
Newbie
Joined: 06 Oct 2025 Posts: 4
|
bruce2359 wrote: |
vbartoni wrote: |
Data in the message should be string/json. |
I believe you that it should be string, but the error message says it isn't. |
tnx, LOL, true, I am unable to verify, will come back here once I figure it out. |
|
Back to top |
|
 |
vbartoni |
Posted: Wed Oct 08, 2025 10:20 pm Post subject: |
|
|
Newbie
Joined: 06 Oct 2025 Posts: 4
|
thank you. wil repost here when I know more about the data with the help of mq queue manager admins |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|