Uploaded image for project: 'AMQ Clients'
  1. AMQ Clients
  2. ENTMQCL-450

[jms] Transactions - commiting message fails with javax.jms.MessageNotWriteableException: Message is currently read-only

XMLWordPrintable

    • Hide

      1) Fire up AMQ 7 broker (tested with ER12/13)
      2) create a queue

      java -jar amqx.jar queue -a add -n lalaQ

      3) Send few messages using the latest qpid-jms 0.20 client

      java  -cp "/var/dtests/node_data/clients/java/aac:/usr/share/java/log4j-amq-1.2.17/log4j-1.2.17.redhat-2.jar:/usr/share/java/slf4j-api-amq-1.7.21/slf4j-api-1.7.21.redhat-3.jar:/usr/share/java/slf4j-log4j-amq-1.7.21/slf4j-log4j12-1.7.21.redhat-3.jar:/var/dtests/node_data/clients/java/aac/lib/jopt-simple-4.8.jar:/usr/share/java/geronimo-jms_2.0_spec-amq-1.0.0/geronimo-jms_2.0_spec-1.0.0.alpha-2-redhat-2.jar:/usr/share/java/qpid-jms-0.20.0/netty-buffer-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-codec-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-codec-http-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-common-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-handler-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-resolver-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-transport-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-buffer-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-codec-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-codec-http-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-common-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-handler-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-transport-4.1.5.Final-redhat-1.jar::/usr/share/java/qpid-proton-java-0.15.0/proton-j-0.15.0.redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/qpid-jms-client-0.20.0.redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/qpid-jms-discovery-0.20.0.redhat-1.jar:/var/dtests/node_data/clients:/var/dtests/node_data/reproducers" -Daac1.jndi=/var/dtests/node_data/clients/java/aac/src/main/resources/jndi.properties  -Dlog4j.configuration=file:/var/dtests/node_data/clients/java/aac/src/main/resources/log4j.properties  com.redhat.mqe.jms.aac1_sender  --log-msgs dict --broker 10.34.33.213:5672 --conn-username admin --conn-password admin --address lalaQ --count 10 --tx-endloop-action commit
      

      Note: CP is using workarounded double netty jars, no need to pay attention to it.

      Show
      1) Fire up AMQ 7 broker (tested with ER12/13) 2) create a queue java -jar amqx.jar queue -a add -n lalaQ 3) Send few messages using the latest qpid-jms 0.20 client java -cp "/ var /dtests/node_data/clients/java/aac:/usr/share/java/log4j-amq-1.2.17/log4j-1.2.17.redhat-2.jar:/usr/share/java/slf4j-api-amq-1.7.21/slf4j-api-1.7.21.redhat-3.jar:/usr/share/java/slf4j-log4j-amq-1.7.21/slf4j-log4j12-1.7.21.redhat-3.jar:/ var /dtests/node_data/clients/java/aac/lib/jopt-simple-4.8.jar:/usr/share/java/geronimo-jms_2.0_spec-amq-1.0.0/geronimo-jms_2.0_spec-1.0.0.alpha-2-redhat-2.jar:/usr/share/java/qpid-jms-0.20.0/netty-buffer-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-codec-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-codec-http-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-common-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-handler-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-resolver-4.1.5.Final-redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/netty-transport-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-buffer-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-codec-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-codec-http-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-common-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-handler-4.1.5.Final-redhat-1.jar:/usr/share/java/netty-all-amq-4.1.5/netty-transport-4.1.5.Final-redhat-1.jar::/usr/share/java/qpid-proton-java-0.15.0/proton-j-0.15.0.redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/qpid-jms-client-0.20.0.redhat-1.jar:/usr/share/java/qpid-jms-0.20.0/qpid-jms-discovery-0.20.0.redhat-1.jar:/ var /dtests/node_data/clients:/ var /dtests/node_data/reproducers" -Daac1.jndi=/ var /dtests/node_data/clients/java/aac/src/main/resources/jndi.properties -Dlog4j.configuration=file:/ var /dtests/node_data/clients/java/aac/src/main/resources/log4j.properties com.redhat.mqe.jms.aac1_sender --log-msgs dict --broker 10.34.33.213:5672 --conn-username admin --conn-password admin --address lalaQ --count 10 --tx-endloop-action commit Note: CP is using workarounded double netty jars, no need to pay attention to it.

      Whenever qpid jms sender client 0.20 tries to commit a messages it fails with r/w permission issue on message.

      com.redhat.mqe.jms.aac1_sender  --log-msgs dict --broker 10.34.33.213:5672 --conn-username admin --conn-password admin --address lalaQ --count 10 --tx-endloop-action commit
      
      [746653770:0] -> Open{ containerId='ID:c8d719d9-dfdb-4ee0-8597-b5d6b5ec6532:1', hostname='10.34.33.213', maxFrameSize=1048576, channelMax=32767, idleTimeOut=30000, outgoingLocales=null, incomingLocales=null, offeredCapabilities=null, desiredCapabilities=[sole-connection-for-container], properties={product=QpidJMS, version=0.20.0.redhat-1, platform=JVM: 1.8.0_51, 25.51-b03, Oracle Corporation, OS: Linux, 3.10.0-514.el7.x86_64, amd64}}
      [746653770:0] <- Open{ containerId='amq', hostname='null', maxFrameSize=4294967295, channelMax=65535, idleTimeOut=30000, outgoingLocales=null, incomingLocales=null, offeredCapabilities=[sole-connection-for-container, DELAYED_DELIVERY], desiredCapabilities=null, properties={product=apache-activemq-artemis, version=1.5.0.amq-700002-redhat-1}}
      [746653770:0] -> Begin{remoteChannel=null, nextOutgoingId=1, incomingWindow=2047, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:0] <- Begin{remoteChannel=0, nextOutgoingId=1, incomingWindow=2147483647, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] -> Begin{remoteChannel=null, nextOutgoingId=1, incomingWindow=2047, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] <- Begin{remoteChannel=1, nextOutgoingId=1, incomingWindow=2147483647, outgoingWindow=2147483647, handleMax=65535, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] -> Attach{name='qpid-jms:coordinator:ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1', handle=0, role=SENDER, sndSettleMode=UNSETTLED, rcvSettleMode=FIRST, source=Source{address='null', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}, target=Coordinator{capabilities=[amqp:local-transactions]}, unsettled=null, incompleteUnsettled=false, initialDeliveryCount=0, maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] <- Attach{name='qpid-jms:coordinator:ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1', handle=0, role=RECEIVER, sndSettleMode=MIXED, rcvSettleMode=FIRST, source=Source{address='null', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=null, capabilities=null}, target=Coordinator{capabilities=[amqp:local-transactions, amqp:multi-txns-per-ssn, amqp:multi-ssns-per-txn]}, unsettled=null, incompleteUnsettled=false, initialDeliveryCount=null, maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] <- Flow{nextIncomingId=1, incomingWindow=2147483647, nextOutgoingId=1, outgoingWindow=2147483647, handle=0, deliveryCount=0, linkCredit=100, available=null, drain=false, echo=false, properties=null}
      [746653770:1] -> Transfer{handle=0, deliveryId=0, deliveryTag=0, messageFormat=0, settled=null, more=false, rcvSettleMode=null, state=null, resume=false, aborted=false, batchable=false} (7) "\x00Sw\x00S1E"
      [746653770:1] <- Disposition{role=RECEIVER, first=0, last=0, settled=true, state=Declared{txnId=3207e64a-b2fc-11e6-b59b-525400061be7}, batchable=false}
      [746653770:1] -> Attach{name='qpid-jms:sender:ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1:lalaQ', handle=1, role=SENDER, sndSettleMode=UNSETTLED, rcvSettleMode=FIRST, source=Source{address='ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=[amqp:accepted:list, amqp:rejected:list], capabilities=null}, target=Target{address='lalaQ', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=[queue]}, unsettled=null, incompleteUnsettled=false, initialDeliveryCount=0, maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] <- Attach{name='qpid-jms:sender:ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1:lalaQ', handle=1, role=RECEIVER, sndSettleMode=MIXED, rcvSettleMode=FIRST, source=Source{address='ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, distributionMode=null, filter=null, defaultOutcome=null, outcomes=[amqp:accepted:list, amqp:rejected:list], capabilities=null}, target=Target{address='lalaQ', durable=NONE, expiryPolicy=SESSION_END, timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=[queue]}, unsettled=null, incompleteUnsettled=false, initialDeliveryCount=null, maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null, properties=null}
      [746653770:1] <- Flow{nextIncomingId=2, incomingWindow=2147483647, nextOutgoingId=1, outgoingWindow=2147483647, handle=1, deliveryCount=0, linkCredit=100, available=null, drain=false, echo=false, properties=null}
      [746653770:1] -> Transfer{handle=1, deliveryId=1, deliveryTag=0, messageFormat=0, settled=null, more=false, rcvSettleMode=null, state=TransactionalState{txnId=3207e64a-b2fc-11e6-b59b-525400061be7, outcome=null}, resume=false, aborted=false, batchable=false} (131) "\x00Sp\xc0\x02\x01A\x00Sr\xc1)\x04\xa3\x0ex-opt-jms-destQ\x00\xa3\x12x-opt-jms-msg-typeQ\x00\x00Ss\xc0I\x0a\xa1/ID:6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1-1@\xa1\x05lalaQ@@@@@@\x83\x00\x00\x01X\x9b\x16}\xb0"
      {'redelivered': False, 'reply_to': None, 'id': '6d1914b8-4c87-4bb4-88e0-5b65428ffee8:1:1:1-1', 'user_id':None, 'correlation_id': None, 'priority': 4, 'durable': True, 'ttl': 0, 'type': None, 'expiration': 0, 'timestamp': 1480070692272, 'address': 'lalaQ', 'properties': {'JMSXDeliveryCount': 1}, 'content': None}
      [746653770:1] <- Disposition{role=RECEIVER, first=1, last=1, settled=true, state=Accepted{}, batchable=false}
      
      11:44:52,338 ERROR Error while sending a message!
      javax.jms.MessageNotWriteableException: Message is currently read-only
      	at org.apache.qpid.jms.message.JmsMessage.checkReadOnly(JmsMessage.java:509)
      	at org.apache.qpid.jms.message.JmsMessage.setJMSDeliveryMode(JmsMessage.java:242)
      	at org.apache.qpid.jms.JmsSession.send(JmsSession.java:741)
      	at org.apache.qpid.jms.JmsSession.send(JmsSession.java:735)
      	at org.apache.qpid.jms.JmsMessageProducer.sendMessage(JmsMessageProducer.java:240)
      	at org.apache.qpid.jms.JmsMessageProducer.send(JmsMessageProducer.java:170)
      	at org.apache.qpid.jms.JmsMessageProducer.send(JmsMessageProducer.java:159)
      	at com.redhat.mqe.jms.SenderClient.startClient(SenderClient.java:100)
      	at com.redhat.mqe.jms.aac1_sender.main(aac1_sender.java:11)
      

              gemmellr Robbie Gemmell
              mtoth@redhat.com Michal Toth
              Michal Toth Michal Toth
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: