Hide Forgot
Created attachment 499124 [details] activemq.xml Description of problem: setJMSMessageID() in the qpid java client validates that the messageid string is a UUID. This conflicts with the MessageID generation of ActiveMQ, which makes a message id out of the producer id (queue/exchange name) and a sequence number. The JMS specification does not seem to have a requirement for the MessageID to be a UUID. The only requirements are that it be preceded by an 'ID:' and be unique within a provider. Version-Release number of selected component (if applicable): qpid-java-client-0.7.946106-15.el5 How reproducible: Always Steps to Reproduce: 1. Set up a JMS to JMS bridge between qpid and ActiveMQ using attached activemq.xml (copy into $ACTIVEMQ_DIR/conf/) 2. Start qpidd and activemq ($ACTIVEMQ_DIR/bin/activemq console) 3. Send a message to jms2jmsQ Actual results: ActiveMQ reply fails with the following exception: ERROR | failed to forward message on attempt: 1 reason: javax.jms.JMSException: MessageId 'ID:dhcp209-12.gsslab.pnq.redhat.com-45266-1305237148981-3:0:3:1:1' is not of the correct format, it must be ID: followed by a UUID message: Body: JMS Correlation ID: null JMS timestamp: 1305237163052 JMS expiration: 0 JMS priority: 4 JMS delivery mode: 2 JMS reply to: null JMS Redelivered: false JMS Destination: queue://jms2jmsQ JMS Type: null JMS MessageID: ID:96ebf863-b620-3932-86cc-860cc4e43bd0 JMS Content-Type: text/plain AMQ message number: 2 Properties:<NONE> javax.jms.JMSException: MessageId 'ID:dhcp209-12.gsslab.pnq.redhat.com-45266-1305237148981-3:0:3:1:1' is not of the correct format, it must be ID: followed by a UUID at org.apache.qpid.client.message.AMQMessageDelegate_0_10.setJMSMessageID(AMQMessageDelegate_0_10.java:165) at org.apache.qpid.client.message.AbstractJMSMessage.setJMSMessageID(AbstractJMSMessage.java:92) at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1727) at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:231) at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:300) at org.apache.activemq.ActiveMQQueueSender.send(ActiveMQQueueSender.java:111) at org.apache.activemq.network.jms.QueueBridge.sendMessage(QueueBridge.java:80) at org.apache.activemq.network.jms.DestinationBridge.onMessage(DestinationBridge.java:129) at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:722) at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:185) at org.apache.qpid.client.BasicMessageConsumer.notifyMessage(BasicMessageConsumer.java:696) at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:207) at org.apache.qpid.client.BasicMessageConsumer_0_10.notifyMessage(BasicMessageConsumer_0_10.java:44) at org.apache.qpid.client.AMQSession$Dispatcher.notifyConsumer(AMQSession.java:3193) at org.apache.qpid.client.AMQSession$Dispatcher.dispatchMessage(AMQSession.java:3137) at org.apache.qpid.client.AMQSession$Dispatcher.access$900(AMQSession.java:2918) at org.apache.qpid.client.AMQSession.dispatch(AMQSession.java:2911) at org.apache.qpid.client.message.UnprocessedMessage.dispatch(UnprocessedMessage.java:55) at org.apache.qpid.client.AMQSession$Dispatcher.run(AMQSession.java:3065) at java.lang.Thread.run(Thread.java:662) Expected results: ActiveMQ sends a reply successfully Additional info: The core behaviour of validating a UUID can also be seen with a standalone program that calls a Message.setJMSMessageID(foo) where foo is not a UUID.
The JMS spec mentions the following for the getMessageID() method, "When a message is sent, JMSMessageID can be ignored. When the send or publish method returns, it contains a provider-assigned value. " Therefore, technically a JMS provider is within it's right to ignore any previously set value and set it's own ID. It also says the following for the setMessageID() method, "JMS providers set this field when a message is sent. This method can be used to change the value for a message that has been received." However it's not quite clearly what should be the behaviour if a received message is being resent after resetting the message id. On the other hand the AMQP spec request all messages to have a unique identifier, hence the reason why we have a validation there. "Message-id is an optional property of UUID type which uniquely identifies a message within the message system." I would be discussing this issue in upstream Qpid project to figure out possible solutions to address this issue and will update the ticket accordingly.
There seem to be similar problems with jboss and qpid connectivity as well. I haven't tried it myself yet.
Hello Is there any update on this issue. Regards Ranjith Ruban
The same problem appears with WebsphereMQ, backtrace: root IPE_NOHIT: javax.jms.JMSException: MessageId 'ID:414d5120495045344445563420202020aa4085502c747620' is not of the correct format, it must be ID: followed by a UUID at org.apache.qpid.client.message.AMQMessageDelegate_0_10.setJMSMessageID(AMQMe ssageDelegate_0_10.java:194) at org.apache.qpid.client.message.AbstractJMSMessage.setJMSMessageID(AbstractJM SMessage.java:63) at com.ibm.mq.jms.MQJMSMessage.setHeaderFromMQMD(MQJMSMessage.java:932) at com.ibm.mq.jms.MQMessageProducer.sendInternal(MQMessageProducer.java:1813) at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:1139) ..
I have proposed a solution upstream, Once we reach some consensus around the issue I plan to implement the solution (or an alternative).
A fix has been committed upstream at http://svn.apache.org/viewvc?rev=1442364&view=rev This issue is tracked via QPID-4566
I tried to start up an ActiveMQ with attached 'activemq.xml' and it fails with configuration errors: ERROR | Failed to load: class path resource [activemq.xml], reason: Line 34 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 160; cvc-complex-type.3.2.2: Attribute 'destroyApplicationContextOnStop' is not allowed to appear in element 'broker'. org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 34 in XML document from class path resource [activemq.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 160; cvc-complex-type.3.2.2: Attribute 'destroyApplicationContextOnStop' is not allowed to appear in element 'broker'. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:530) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:444) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64) at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52) at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:101) at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:101) at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:65) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71) at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54) at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:125) at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:84) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150) at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57) at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.activemq.console.Main.runTaskClass(Main.java:262) at org.apache.activemq.console.Main.main(Main.java:115) Caused by: org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 160; cvc-complex-type.3.2.2: Attribute 'destroyApplicationContextOnStop' is not allowed to appear in element 'broker'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:387) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:321) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:421) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3186) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2663) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2070) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:709) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) ... 26 more When I try to start ActiveMQ with original 'activemq.xml' it starts correctly without errors. I'm using last ActiveMQ 5.8 from http://activemq.apache.org/activemq-580-release.html Could you please update the activemq.xml to final version of ActiveMQ? Raising NEEDINFO
Rajith since you didn't answer me, I reraising needinfo, please see Comment 7
We've found that parameter "destroyApplicationContextOnStop" is obsolete in latest reference http://activemq.apache.org/xml-reference.html . By omitting it we moved to another error, which we can't solve. ERROR | Failed to load: class path resource [activemq.xml], reason: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Cannot create inner bean 'jmsQueueConnector#608314f2' of type [org.apache.activemq.network.jms.JmsQueueConnector] while setting bean property 'jmsBridgeConnectors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsQueueConnector#608314f2' defined in class path resource [activemq.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.jndi.JndiTemplate' to required type 'org.apache.activemq.network.jms.JndiLookupFactory' for property 'jndiOutboundTemplate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.jndi.JndiTemplate] to required type [org.apache.activemq.network.jms.JndiLookupFactory] for property 'jndiOutboundTemplate': no matching editors or conversion strategy found ... Please advice.
Steps to reproduce. (Just using Qpid) 1. Create a message, set any string as message-id, observe no exception is thrown. 2. Then receive it and try to set any string as message-id and observe that no exception is thrown. (Using Qpid and ActiveMQ) 1. Send a message to using Qpid. 2. Create an app that receives the message from Qpid and then sends it using ActiveMQ. 3. Observe no exception is being thrown in step 2.
Zdenek, I don't know about ActiveMQ. I didn't use it to verify the fix. Regards, Rajith
Reproducing (Just using Qpid) 1. Create a message, set any string as message-id, observe no exception is thrown. 2. Then receive it and try to set any string as message-id and observe that no exception is thrown. --- Received error: javax.jms.JMSException: MessageId 'ThisIsMyID' is not of the correct format, it must be ID: followed by a UUID at org.apache.qpid.client.message.AMQMessageDelegate_0_10.setJMSMessageID(AMQMessageDelegate_0_10.java:199) at org.apache.qpid.client.message.AbstractJMSMessage.setJMSMessageID(AbstractJMSMessage.java:63) at org.apache.qpid.example.Hello.runTest(Hello.java:63) at org.apache.qpid.example.Hello.main(Hello.java:40) JMSMessageID strings we've tried: "ThisIsMyID" "ID:ThisIsMyID" Both with same result Packages: qpid-cpp-server-0.18-14.el6.x86_64 qpid-java-client-0.18-7.el6.noarch
Verified and fixed. No more JMSExpcetion complain about MessageId format. Packages: RHEL6 qpid-cpp-server-0.22-4 qpid-java-client-0.22-3.el6.noarch RHEL 5 qpid-cpp-server-0.22-4 qpid-java-client-0.22-2.el5.noarch
The new client use the same solution used for the old client to handle this issue. You use the same steps mentioned in comment#11 to verify the issue. Note: Please make sure you are using the new client and not the old one.
The new client uses the same solution as the old one. You could use the same steps as mentioned in comment #11 to verify it. Please make sure you are using the new client instead of the old one.
Rajith, the should be getting the new client by default, true? (In reply to Rajith Attapattu from comment #17) > The new client uses the same solution as the old one. > > You could use the same steps as mentioned in comment #11 to verify it. > Please make sure you are using the new client instead of the old one.
Replying to clear the needinfo flag. We don't have a new client anymore.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-1296.html