Hi Timothy And Team,


I posted below details through web ui
http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html  but
latest comment and new topic is not reflecting on UI. I think, there is
some issue on UI.

#######


We are having one issue, so need your to help to fix this issue.

As per your suggestion on issue -
http://qpid.2158936.n2.nabble.com/Better-way-to-handle-MessageNotWriteableException-Message-is-currently-read-only-td7684002.html
,

i am creating JMSMessage again whenever producer failed to send message.

For achieving this scenario, i need to extract(read) message content from
original JMS message. While extracting message content for
JmsBytesMessage/JmsStreamMessage,  i am getting error
"javax.jms.MessageNotReadableException: Message body is write-only".

I also did similar testing for JmsTextMessage, JmsMapMessage,
JmsObjectMessage but there is no issue in these type of messages. We are
having issue only for JmsStreamMessage and JmsBytesMessage.

I did testing with "qpid-jms-client-0.40.0", "qpid-jms-client-0.43.0" and
"qpid-jms-client-0.45.0". Having same issue in all three of jars.

Please find attached error stack trace “JmsBytesMessage_Error.txt” and
“JmsStreamMessage_Error.txt”.

How To reproduce this issue ? – I did testing with ServiceBus.
1. First send message to Queue
2. Disable Queue/topic
3. Enable Queue/topic
4. Send message again which will throw error
“javax.jms.MessageNotReadableException: Message body is write-only”

Please find below code snippet for JmsBytesMessage

try {
        sendMessage(message);
} catch (IllegalStateException illegalStateException) {
        // Reset Producer due to Idle TimeOut after 10m
        resetProducer();

        Message recreatedMessage = reCreateMessage(message);
        sendMessage(recreatedMessage);
}

Public Message reCreateMessage(Message message){
        byte[] content = getMessageContent(message);

        BytesMessage bMsg = session.createBytesMessage();
        bMsg.writeBytes(content);

        return bMsg;
}

Public byte[] getMessageContent(Message message){
        BytesMessage message = (JmsBytesMessage)message;
        byte[] bytes = new byte[(int) message.getBodyLength()];
        message.readBytes(bytes);
        return bytes;
}



Please let me know if you need any details.

Regards,
Abhishek Kumar
Root Exception stack trace:
javax.jms.MessageNotReadableException: Message body is write-only
        at 
org.apache.qpid.jms.message.JmsMessage.checkWriteOnlyBody(JmsMessage.java:527)
        at 
org.apache.qpid.jms.message.JmsBytesMessage.initializeReading(JmsBytesMessage.java:430)
        at 
org.apache.qpid.jms.message.JmsBytesMessage.getBodyLength(JmsBytesMessage.java:76)
        at 
org.mule.abc.servicebus.Utils.extractByteArrayFromMessage(Utils.java:380)
        at org.mule.abc.servicebus.Utils.toObject(Utils.java:365)
        at org.mule.abc.servicebus.Sender.recreateJMSMessage(Sender.java:263)
        at org.mule.abc.servicebus.Sender.dispatchEvent(Sender.java:231)
        at org.mule.abc.servicebus.Sender.doDispatch(Sender.java:91)
        at 
org.mule.abc.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:109)
        at 
org.mule.abc.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2735)
        at 
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
        at 
org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
        at 
org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
        at 
org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
        at 
org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
        at 
org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)
        at 
org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:129)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:213)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:206)
        at 
org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
        at 
org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
        at 
org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
        at 
org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
        at 
org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
        at 
org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
        at 
org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
        at 
org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
        at 
org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
        at 
org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
        at 
org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
        at 
org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
        at 
org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
        at 
org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)
        at 
org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:205)
        at 
org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:53)
        at org.mule.work.WorkerContext.run(WorkerContext.java:301)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

********************************************************************************
Root Exception stack trace:
javax.jms.MessageNotReadableException: Message body is write-only
        at 
org.apache.qpid.jms.message.JmsMessage.checkWriteOnlyBody(JmsMessage.java:527)
        at 
org.apache.qpid.jms.message.JmsStreamMessage.readString(JmsStreamMessage.java:247)
        at org.mule.abc.servicebus.Utils.toObject(Utils.java:371)
        at org.mule.abc.servicebus.Sender.recreateJMSMessage(Sender.java:263)
        at org.mule.abc.servicebus.Sender.dispatchEvent(Sender.java:231)
        at org.mule.abc.servicebus.Sender.doDispatch(Sender.java:91)
        at 
org.mule.abc.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:109)
        at 
org.mule.abc.AbstractConnector$DispatcherMessageProcessor.process(AbstractConnector.java:2735)
        at 
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27)
        at 
org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108)
        at 
org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
        at 
org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)
        at 
org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)
        at 
org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)
        at 
org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:129)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:213)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:206)
        at 
org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
        at 
org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
        at 
org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
        at 
org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
        at 
org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
        at 
org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
        at 
org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
        at 
org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
        at 
org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
        at 
org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
        at 
org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
        at 
org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
        at 
org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
        at 
org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)
        at 
org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
        at 
org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:205)
        at 
org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:53)
        at org.mule.work.WorkerContext.run(WorkerContext.java:301)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

********************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to