[
https://issues.apache.org/jira/browse/AMQ-4554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666180#comment-13666180
]
Nico Brys commented on AMQ-4554:
--------------------------------
Hi [~tabish121], the version doesn't mather. The source code is still the same
(See my previous comment... This source is from there current release).
The test case is rather easy.. Just send a message with activeMQ and receive
message with ActiveMQ where you request the property...
Found this also:
{noformat}
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();{noformat}
> NumberFormatException when parsing JMSXProducerTXID
> ---------------------------------------------------
>
> Key: AMQ-4554
> URL: https://issues.apache.org/jira/browse/AMQ-4554
> Project: ActiveMQ
> Issue Type: Bug
> Affects Versions: 5.5.1
> Environment: Mac / Windows
> Reporter: Nico Brys
> Priority: Blocker
>
> When creating a simple message using ActiveMQ and trying to receive that same
> message. We get the following stacktrace when trying to retrieve
> JMSXProducerTXID.
> {noformat}
> [SEVERE] Thread death for Transacted Thread caused by For input string:
> "TX:ID:ID-PC12010.local-59923-1369316134520-2:10:1"
> java.lang.NumberFormatException: For input string:
> "TX:ID:ID-PC12010.local-59923-1369316134520-2:10:1"
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:449)
> at java.lang.Integer.<init>(Integer.java:660)
> 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:509)
> at
> org.apache.activemq.command.ActiveMQMessage.getStringProperty(ActiveMQMessage.java:604)
> at
> com.id.scriptura.documentflow.standard.impl.jms.JMSMessageConsumerStep$TransactedMessageReceiver.run(Unknown
> Source)
> at java.lang.Thread.run(Thread.java:680)
> {noformat}
> This property is set by ActiveMQ and NOT by our application. The code for
> retrieving is like this:
> msg.getStringProperty(JMSXProducerTXID)
--
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