You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Nico Brys (JIRA)" <ji...@apache.org> on 2013/05/24 11:36:20 UTC

[jira] [Commented] (AMQ-1831) Message.getStringProperty("JMSXProducerTXID") throws java.lang.NumberFormatException

    [ https://issues.apache.org/jira/browse/AMQ-1831?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666157#comment-13666157 ] 

Nico Brys commented on AMQ-1831:
--------------------------------

This issue should be reopened! We just the method message.getStringProperty("JMSXProducerTXID") and we also get a NumberFormatException. We don't set this property manually on the message! It's activeMQ who does this. 
                
> Message.getStringProperty("JMSXProducerTXID") throws java.lang.NumberFormatException
> ------------------------------------------------------------------------------------
>
>                 Key: AMQ-1831
>                 URL: https://issues.apache.org/jira/browse/AMQ-1831
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.1.0
>         Environment: Windows XP SP2
>            Reporter: Joel Turkel
>             Fix For: 5.3.0
>
>
> A  java.lang.NumberFormatException is thrown when attempting to retrieve the JMSXProducerTXID from a message. The stack trace is:
> Exception in thread "main" java.lang.NumberFormatException: For input string: "TX:ID:JTURKEL-690-4629-1214839585805-0:0:1"
> 	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> 	at java.lang.Integer.parseInt(Integer.java:447)
> 	at java.lang.Integer.<init>(Integer.java:620)
> 	at org.apache.activemq.filter.PropertyExpression$14.evaluate(PropertyExpression.java:147)
> 	at org.apache.activemq.filter.PropertyExpression.evaluate(PropertyExpression.java:194)
> 	at org.apache.activemq.command.ActiveMQMessage.getObjectProperty(ActiveMQMessage.java:447)
> 	at org.apache.activemq.command.ActiveMQMessage.getStringProperty(ActiveMQMessage.java:535)
> 	at com.queue.test.MQTest.testBug(MQTest.java:41)
> 	at com.queue.test.ActiveMQTest.main(ActiveMQTest.java:21)
> Here is some simple test code to reproduce the problem:
> 		ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(ActiveMQConnection.DEFAULT_USER, 
> 				ActiveMQConnection.DEFAULT_PASSWORD, ActiveMQConnection.DEFAULT_BROKER_URL)
> 		Connection connection = connectionFactory.createConnection();		
> 		connection.start();
> 		Session producerSession = connection.createSession(true, Session.SESSION_TRANSACTED);
> 		MessageProducer producer = producerSession.createProducer(producerSession.createQueue("myQueue"));
> 		TextMessage producerMessage = producerSession.createTextMessage("Test Message");
> 		producer.send(producerMessage);
> 		producer.close();
> 		producerSession.commit();
> 		producerSession.close();
> 		
> 		Session consumerSession = connection.createSession(true, Session.SESSION_TRANSACTED);
> 		MessageConsumer consumer = consumerSession.createConsumer(consumerSession.createQueue("myQueue"));
> 		Message consumerMessage = consumer.receive(1000);
> 		System.out.println(consumerMessage.getStringProperty("JMSXProducerTXID"));
> 		consumer.close();
> 		consumerSession.commit();
> 		consumerSession.close();
> 		connection.close();
> This problem is quite severe for us since we need the transaction id property and would like to certify against ActiveMQ.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira