简体   繁体   English

导致异常的IBM字符集标题

[英]IBM Character Set Header Causing Exceptions

We have a Spring Integration flow which consumes messages off a Websphere MQ Manager queue. 我们有一个Spring Integration流,它消耗Websphere MQ Manager队列中的消息。 These messages are put through a simple process and afterwards are put into another queue (in the same MQ Manager). 这些消息通过一个简单的过程放入,然后放入另一个队列(在同一MQ Manager中)。

When we try to write the messages to the final destination queue, we are getting the following error: 当我们尝试将消息写入最终目标队列时,出现以下错误:

Caused by: javax.jms.JMSException: MQJMS1006: invalid value for 'JMS_IBM_Character_Set': 'IBM850'.
        at com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:431) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1153) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:779) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2718) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:907) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:762) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:393) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:333) ~[com.ibm.mqjms-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
        at org.springframework.jms.connection.CachedMessageProducer.send(CachedMessageProducer.java:181) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:636) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:607) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:584) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:494) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:580) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:706) ~[spring-jms-4.2.1.RELEASE.jar:4.2.1.RELEASE]
        at org.springframework.integration.jms.JmsSendingMessageHandler.send(JmsSendingMessageHandler.java:145) ~[spring-integration-jms-4.2.0.RELEASE.jar:?]
        at org.springframework.integration.jms.JmsSendingMessageHandler.handleMessageInternal(JmsSendingMessageHandler.java:115) ~[spring-integration-jms-4.2.0.RELEASE.jar:?]
        at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.0.RELEASE.jar:?]

The messages we pick up from the initial queue have the following IBM-Specific headers: 我们从初始队列中提取的消息具有以下IBM特定的标头:

JMS_IBM_Character_Set=IBM850,
JMS_IBM_MQMD_CodedCharSetId=850,
JMS_IBM_Encoding=17,
JMS_IBM_PutApplType=11,
JMS_IBM_Format=        ,
JMSXDeliveryCount=1,
JMS_IBM_PutTime=12534150,
JMS_IBM_MsgType=8

and they are still there when we try and write the processed message into the final Websphere MQ Queue. 当我们尝试将已处理的消息写入最终的Websphere MQ队列时,它们仍然存在。

The project is using the following IBM MQ dependency jars: 该项目正在使用以下IBM MQ依赖项jar:

compile 'com.ibm:com.ibm.mq:7.0.1.3'
compile 'com.ibm:com.ibm.mqjms:7.0.1.3'
compile 'com.ibm:com.ibm.mq.jmqi:7.0.1.3'
compile 'com.ibm:com.ibm.mq.headers:7.0.1.3'

What is the correct way of resolving this exception? 解决此异常的正确方法是什么? Should we: 我们应该吗:

  1. Strip any JMS_IBM_XXX headers from the message before writing to the final Websphere MQ Queue? 在写入最终的Websphere MQ队列之前,从消息中剥离所有JMS_IBM_XXX标头?
  2. Use different version jars? 使用不同版本的罐子?
  3. Do something else entirely? 完全做其他事情吗?

We don't seem to experience this issue in any other flows that pick up messages from a Websphere MQ queue and finally writes them to another Websphere MQ queue. 在从Websphere MQ队列中提取消息并将它们最终写入另一个Websphere MQ队列的其他任何流程中,我们似乎都没有遇到这个问题。

Quoting WebSphere MQ 7.5 - MS_IBM_Character_Set : 引用WebSphere MQ 7.5-MS_IBM_Character_Set

Prior to WebSphere® MQ V7.5, applications using WebSphere MQ messaging provider migration mode could set the JMS_IBM_Character_Set property of a message to a numerical Coded Character Set Identifier. 在WebSphere®MQ V7.5之前,使用WebSphere MQ消息传递提供程序迁移模式的应用程序可以将消息的JMS_IBM_Character_Set属性设置为数字编码字符集标识符。

When the message was sent, the Coded Character Set Identifier stored in the JMS_IBM_Character_Set property was mapped to the MQMD field CodedCharacterSetID. 发送消息时,存储在JMS_IBM_Character_Set属性中的编码字符集标识符已映射到MQMD字段CodedCharacterSetID。

When using the WebSphere MQ V7.5 classes for JMS, a JMSException containing the message: 当将WebSphere MQ V7.5类用于JMS时,包含消息的JMSException:

 MQJMS1006: invalid value for 'JMS_IBM_Character_Set': '<number>' 

is thrown if an application tries to send a message that has the JMS_IBM_Character_Set property set to a numerical Coded Character Set Identifier. 如果应用程序尝试发送将JMS_IBM_Character_Set属性设置为数字编码字符集标识符的消息,则会引发。

The JMS_IBM_Character_Set property must be set to the Java character set string that maps to the Coded Character Set Identifier that the application wants to use. 必须将JMS_IBM_Character_Set属性设置为Java字符集字符串,该字符串映射到应用程序要使用的编码字符集标识符。 For more information, see Mapping JMS fields onto WebSphere MQ fields (outgoing messages) 有关更多信息,请参阅将JMS字段映射到WebSphere MQ字段(传出消息)

Since you are using version 7.0.1.3, not 7.5 or later, the value must be a "numerical Coded Character Set Identifier " , meaning it should be 850 (numerical), not IBM850 . 由于您使用的是7.0.1.3版本,而不是7.5或更高版本,因此该值必须是“数字编码字符集标识符 ,这意味着它应该是850 (数字),而不是IBM850

In version 7.5 it should be IBM850 . 在7.5版中,它应该是IBM850

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM