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:46:20 UTC

[jira] [Commented] (AMQ-4554) NumberFormatException when parsing JMSXProducerTXID

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

Nico Brys commented on AMQ-4554:
--------------------------------

The code from activeMQ

{noformat}
  JMS_PROPERTY_EXPRESSIONS.put("JMSXProducerTXID", new SubExpression() {
 
           public Object evaluate(Message message) {
               TransactionId txId = message.getOriginalTransactionId();
               if (txId == null) {
                   txId = message.getTransactionId();
               }
               if (txId == null) {
                   return null;
               }
               return new Integer(txId.toString());
           }
       });
{noformat}

JMS Spec:

MSXProducerTXID String Provider on
Send
The transaction identifier of the
transaction within which this
message was produced

Please see: http://docs.oracle.com/cd/E19957-01/816-5904-10/816-5904-10.pdf page 36
                
> 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