Issue Details (XML | Word | Printable)

Key: MULE-3279
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Andrew Perepelytsya
Reporter: Angelo Bresci
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Mule

Error: javax.jms.JMSException: MQJMS1013: operation invalid whilst session is using asynchronous delivery

Created: 22/Apr/08 01:42 PM   Updated: 09/Jul/08 04:40 PM
Component/s: Core: Transports
Affects Version/s: 1.4.3
Fix Version/s: 1.4.4

Time Tracking:
Not Specified

File Attachments: 1. XML File wmq-echo-config.xml (4 kB)


Labels:
User impact: High


 Description  « Hide
When using org.mule.providers.jms.JmsTransactionFactory, reading from one JMS (Websphere MQ) queue, and writing to another, the following error occurs:

Root Exception stack trace:
javax.jms.JMSException: MQJMS1013: operation invalid whilst session is using asynchronous delivery

Per eng. suggestion, I applied the MultiConsumerJMSMessageReceiver patch (from EE-118). However, there was only a slight change in behavior:

WITHOUT the patch, the error only occured after sending a message to the component connecting the queues
WITH the patch, the error occurred immediately when the Mule server started.



 All   Comments   Work Log   Change History   Transitions   FishEye      Sort Order: Ascending order - Click to sort in descending order
Andrew Perepelytsya added a comment - 22/Apr/08 02:28 PM
Angelo, first, you have to apply the receiver both to message.receiver and transacted.message.receiver. Then try again. Next, I'd suggest having 2 connectors for separate send and receive. This error is one of those bizarre wmq things that do not happen elsewhere (just try googling around for MQJMS1013 - it reportedly failed even for wmq sample apps...). Hard to tell more without a stacktrace, what endpoint does it fail at exactly?

Angelo Bresci added a comment - 22/Apr/08 02:44 PM
Thanks Andrew.

I tried configuring the message.receiver as well, but it didn't change the behavior.

Here's the trace:

********************************************************************************
Message : Failed to route event via endpoint: MuleEndpoint{endpointUri=jms://local_q?targetClient=1, connector=WebsphereJmsConnector{this=9a8a68,
started=true, initialised=true, name='mqConnector', disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=t
rue, supportedProtocols=[jms], serviceOverrides={message.receiver=org.mule.providers.jms.MultiConsumerJmsMessageReceiver, transacted.message.receiver=org.mule.p
roviders.jms.MultiConsumerJmsMessageReceiver}}, transformer=ObjectToJMSMessage{this=145e2d5, name='ObjectToJMSMessage', ignoreBadInput=false, returnClass=null, sourceTypes=[]}, name='endpoint.jms.local.q', type='senderAndReceiver', properties={targetClient=1}, transactionConfig=Transaction{factory=null, action=NONE, ti meout=30000}, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=null, initialState=started, createConnector=0, rem
oteSync=false, remoteSyncTimeout=null, endpointEncoding=null}. Message payload is of type: String
Type : org.mule.umo.provider.DispatchException
Code : MULE_ERROR-42999
Payload : hello!
JavaDoc : http://mule.mulesource.org/docs/apidocs/org/mule/umo/provider/DispatchException.html
JMS Code : MQJMS1013
********************************************************************************

Looks like it's failing at the outbound endpoint for the transaction.

Sorry, I forgot to post the case link initially in this record. You can find more info there as well...

https://na1.salesforce.com/50030000004rJsI


Angelo Bresci added a comment - 22/Apr/08 02:46 PM
Also, is there anything special i need to do if I configure another connector for "send", besides exclude the serviceOverride?

Andrew Perepelytsya added a comment - 22/Apr/08 02:56 PM
Don't exclude serviceOverrides, but for each endpoint ensure a connector attribute is specified (should be different).

Angelo Bresci added a comment - 22/Apr/08 03:37 PM
I got a different error when using separate connectors for send and receive endpoints:

********************************************************************************
Exception stack is:
1. Jms session should be transacted (org.mule.transaction.IllegalTransactionStateException)
org.mule.providers.jms.JmsTransaction:44 (http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html)
********************************************************************************
Root Exception stack trace:
org.mule.transaction.IllegalTransactionStateException: Jms session should be transacted
at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:44)
at org.mule.providers.jms.JmsConnector.getSession(JmsConnector.java:472)
at org.mule.providers.jms.JmsConnector.getSession(JmsConnector.java:438)
at org.mule.providers.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:126)
at org.mule.providers.jms.JmsMessageDispatcher.doSend(JmsMessageDispatcher.java:330)
at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:224)
at org.mule.providers.AbstractConnector.send(AbstractConnector.java:1629)
at org.mule.impl.ImmutableMuleEndpoint.send(ImmutableMuleEndpoint.java:955)
at org.mule.impl.MuleSession.sendEvent(MuleSession.java:327)
at org.mule.impl.MuleSession.sendEvent(MuleSession.java:210)
at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:120)
at org.mule.routing.outbound.FilteringOutboundRouter.route(FilteringOutboundRouter.java:66)
at org.mule.routing.outbound.OutboundPassThroughRouter.route(OutboundPassThroughRouter.java:79)
at org.mule.routing.outbound.OutboundRouterCollection$1.doInTransaction(OutboundRouterCollection.java:66)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:39)
at org.mule.routing.outbound.OutboundRouterCollection.route(OutboundRouterCollection.java:71)
at org.mule.routing.inbound.ForwardingConsumer.process(ForwardingConsumer.java:51)
at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:86)
at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
at org.mule.providers.AbstractReceiverWorker$1.doInTransaction(AbstractReceiverWorker.java:107)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
at org.mule.providers.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:124)
at org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
at java.lang.Thread.run(Thread.java:619)

********************************************************************************


Andrew Perepelytsya added a comment - 22/Apr/08 03:40 PM
Have you declared TX attributes on every endpoint? This includes outbound. Also please try with 1.4.4-SNAPSHOT.

Angelo Bresci added a comment - 22/Apr/08 04:47 PM - edited
I tried declaring "ALWAYS_JOIN" on my outbound endpoint, etc, but wound up with the following error:

********************************************************************************
Message : Only a single resource can be bound to this type of transaction
Type : org.mule.transaction.IllegalTransactionStateException
Code : MULE_ERROR-91380
JavaDoc : http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html
********************************************************************************
Exception stack is:
1. Only a single resource can be bound to this type of transaction (org.mule.transaction.IllegalTransactionStateException)
org.mule.transaction.AbstractSingleResourceTransaction:130 (http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html
)
********************************************************************************
Root Exception stack trace:
org.mule.transaction.IllegalTransactionStateException: Only a single resource can be bound to this type of transaction
at org.mule.transaction.AbstractSingleResourceTransaction.bindResource(AbstractSingleResourceTransaction.java:130)
at org.mule.providers.jms.JmsTransaction.bindResource(JmsTransaction.java:52)
at org.mule.providers.jms.JmsConnector.getSession(JmsConnector.java:472)
at org.mule.providers.jms.JmsConnector.getSession(JmsConnector.java:438)
at org.mule.providers.jms.JmsMessageDispatcher.dispatchMessage(JmsMessageDispatcher.java:126)
at org.mule.providers.jms.JmsMessageDispatcher.doSend(JmsMessageDispatcher.java:330)
at org.mule.providers.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:224)
at org.mule.providers.AbstractConnector.send(AbstractConnector.java:1629)
at org.mule.impl.ImmutableMuleEndpoint.send(ImmutableMuleEndpoint.java:955)
at org.mule.impl.MuleSession.sendEvent(MuleSession.java:327)
at org.mule.impl.MuleSession.sendEvent(MuleSession.java:210)
at org.mule.routing.outbound.AbstractOutboundRouter.send(AbstractOutboundRouter.java:120)
at org.mule.routing.outbound.FilteringOutboundRouter.route(FilteringOutboundRouter.java:66)
at org.mule.routing.outbound.OutboundPassThroughRouter.route(OutboundPassThroughRouter.java:79)
at org.mule.routing.outbound.OutboundRouterCollection$1.doInTransaction(OutboundRouterCollection.java:66)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:39)
at org.mule.routing.outbound.OutboundRouterCollection.route(OutboundRouterCollection.java:71)
at org.mule.routing.inbound.ForwardingConsumer.process(ForwardingConsumer.java:51)
at org.mule.routing.inbound.InboundRouterCollection.route(InboundRouterCollection.java:86)
at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:581)
at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:322)
at org.mule.providers.AbstractReceiverWorker$1.doInTransaction(AbstractReceiverWorker.java:107)
at org.mule.transaction.TransactionTemplate.execute(TransactionTemplate.java:92)
at org.mule.providers.AbstractReceiverWorker.doRun(AbstractReceiverWorker.java:124)
at org.mule.providers.AbstractReceiverWorker.run(AbstractReceiverWorker.java:60)
at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
at java.lang.Thread.run(Thread.java:619)

********************************************************************************

Unfortunately, this is a client issue, and they're using 1.4.3 in production. So, I am focused on that version for now. If there's a fix for this in benecia, we may have to backport it.

Thanks again for helping. I really appreciate it.


Angelo Bresci added a comment - 22/Apr/08 07:52 PM
Andrew,

I've confirmed that the original config I attached (single connector, transaction on inbound endpoint) does, in fact, work with 1.4.4-SNAPSHOT. I see the messages going through the queues.

WMQ version is 6.0.

Unfortunately, the only pre-configured version of websphere MQ I've used is on my laptop. I believe Eugene installed one at 172.16.10.146 as well today, but I'm not sure if it's externally accessible. The settings are all default, and here are some queues you can use to test:

mule.input
mule.request
mule.response


Andrew Perepelytsya added a comment - 07/May/08 11:05 AM
Dived into the issue again, here are my observations:
  1. I works in 1.4.4 as per Angelo's comment above http://mule.mulesource.org/jira/browse/MULE-3279?focusedCommentId=22887#action_22887
  2. There are testcases which have this config and work fine. E.g. in EE trunk these would be jms-single-tx-recieve-send-in-one-tx.xml, jms-single-tx-BEGIN_OR_JOIN_AND_ALWAYS_BEGIN.xml and jms-single-tx-ALWAYS_BEGIN-configuration.xml. Don't know if all EE trunk changes are in 1.6 release branch, at least poms claim they are the 1.6.1-EE version
  3. The whole ordeal with WMQ MQJMS1013: operation invalid whilst session is using asynchronous delivery error smells badly, as I for the life of me wasn't able to find any references for this requirement in the JMS spec. You know I can look for things, don't you? The closest related mention of async delivery is on page 60 of the jms 1.1 (pdf) spec, in the note on the page:

There are no restrictions on the number of threads that can use a Session object or those it creates. The restriction
is that the resources of a Session should not be used concurrently by multiple threads. It is up to the user
to insure that this concurrency restriction is met. The simplest way to do this is to use one thread. In the case
of asynchronous delivery, use one thread for setup in stopped mode and then start asynchronous delivery.
In more complex cases the user must provide explicit synchronization.

In case of MultiConsumerJmsMessageReceiver there are multiple receiving sessions, and each session is guaranteed to be used by a single thread, read my comments here:
http://svn.mule.codehaus.org/browse/mule/trunk/mule/transports/jms/src/main/java/org/mule/providers/jms/MultiConsumerJmsMessageReceiver.java?r=10740#l250

If there's a need to provide a workaround for WMQ, it has to be scoped differently, as the changes can have wide-spread effect. I'm inclined to close this issue then.


Angelo Bresci added a comment - 13/May/08 01:07 AM
This ticket can be closed. As of 1.4.4, this can be corrected with the following service overrides:

serviceOverrides=
message.receiver=org.mule.providers.jms.MultiConsumerJmsMessageReceiver
transacted.message.receiver=org.mule.providers.jms.MultiConsumerJmsMessageReceiver


Dirk Olmes added a comment - 13/May/08 01:51 AM
Closing as per Angelo's comment

Andrew Perepelytsya added a comment - 19/May/08 10:08 AM
Reopen as per Kevin's and Angelo's request

Hassan Sajjad added a comment - 07/Jul/08 03:44 PM

Angelo, with Mule 1.4.4 upgrade effort, we are encountering this problem... Using two different connectors for sends and receives seems to bypass this issue, however, we then see that once the message has been received/sent successfully, the connector goes offline, so any subsequent messages remain idle on the queue. There are no errors in the logs either.
In summary, we are confronted with two issues; first one is the issue described here and the second one is with the two connector definition workaround that disable both the connectors after first message is processed successfully. I can provide you more details on the config, as per your request.


Angelo Bresci added a comment - 07/Jul/08 03:58 PM
Hassan,

In 1.4.4, you should no longer have to define multiple connectors. This was only necessary prior to the fix.

In our tests, the original reported error no longer appeared (with the service overrides). Are you seeing something different? If so, please let us know, and post your config files if possible.

Cheers,

Angelo


Hassan Sajjad added a comment - 08/Jul/08 04:40 AM
Angelo,

We are getting the same error :

2008-07-08 10:06:21,080 ERROR [vmProfileConnector.receiver.2] [] Failed to dispatch to async audit service. Cause: MQJMS1013: operation invalid whilst session is using asynchronous delivery
2008-07-08 10:06:21,080 ERROR [vmProfileConnector.receiver.2] [] org.mule.umo.provider.DispatchException: Failed to route event via endpoint: MuleEndpoint{endpointUri=jms://cn=AUDIT.IN,cn=bus-eqqm, connector=WebsphereJmsConnector{this=1712193, started=true, initialised=true, name='vmProfileConnector', disposed=false, numberOfConcurrentTransactedReceivers=2, createMultipleTransactedReceivers=true, connected=true, supportedProtocols=[jms], serviceOverrides={message.receiver=com.*.mule.jms.BusTransactionCompliantJmsMessageReceiver, transacted.message.receiver=com.*.mule.jms.BusTransactionCompliantJmsMessageReceiver}}, transformer=ObjectToJMSMessage{this=145d7f2, name='ObjectToJMS', ignoreBadInput=false, returnClass=class java.lang.Object, sourceTypes=[]}, name='AsyncAuditEntry', type='senderAndReceiver', properties={}, transactionConfig=Transaction{factory=com.**.mule.transactions.BusTransactionFactory@6489f0, action=ALWAYS_JOIN, timeout=30000}, filter=null, deleteUnacceptedMessages=false, initialised=true, securityFilter=null, synchronous=null, initialState=started, createConnector=0, remoteSync=false, remoteSyncTimeout=10000, endpointEncoding=null}. Message payload is of type: String

The connector used (vmProfileConnector) for send and receive:
<connector name="vmProfileConnector" className="org.mule.providers.jms.websphere.WebsphereJmsConnector">
<properties>
<property name="eagerConsumer" value="false"/>
<property name="connectionFactoryJndiName" value="cn=LNDSBUS1QCF,cn=bus-eqqm"/>
<property name="jndiInitialFactory" value="com.sun.jndi.ldap.LdapCtxFactory"/>
<property name="jndiProviderUrl" value="ldap://ibmb-bmap01d:1389/dc=uk,dc=**,dc=com"/>
<property name="specification" value="1.1"/>
<property name="jndiDestinations" value="true"/>
<property name="maxRedelivery" value="2" />
<property name="numberOfConcurrentTransactedReceivers" value="2" />
<map name="serviceOverrides">
<property name="message.receiver" value="com.**.mule.jms.BusTransactionCompliantJmsMessageReceiver"/>
<property name="transacted.message.receiver" value="com.**.mule.jms.BusTransactionCompliantJmsMessageReceiver"/>
</map>
</properties>
<!-- thread profile -->
<threading-profile maxThreadsActive="10" maxThreadsIdle="5" threadTTL="60000" poolExhaustedAction="WAIT" />
<!-- retry profile -->
<connection-strategy className="org.mule.providers.SimpleRetryConnectionStrategy">
<properties>
<property name="retryCount" value="4"/>
<property name="frequency" value="10000"/>
<property name="doThreading" value="true"/>
</properties>
</connection-strategy>
</connector>

As stated in my last comment, if we use two different connectors for send and receive then we don't see this issue, however, the connector silently dies after the first message is processed through it.

BusTransactionCompliantJmsMessageReceiver is a wrapper for JmsMessageReceiver that provides us with the customized ability to bind our own Transactions - this is w.r.t support issue: http://na1.salesforce.com/sserv/casedetailview.jsp?id=500300000059zJl

I'll attach the BusTransactionCompliantJmsMessageReceiver source on this jira.

Note I have used ** at various places here and on the attached source to hide company specific info.

This however, goes away if we use 2 connectors


Angelo Bresci added a comment - 08/Jul/08 12:26 PM
Hassan,

I did some additional testing this morning, and confirmed this is not an issue in our receiver (I used MultiConsumerJmsMessageReceiver, which is recommended). I was able to pull transacted messages off one queue, and place them in two separate queues via an outbound router, and no errors were encountered.

I was not able to do this previously (prior to 1.4.4) using the same MultiConsumerJmsMessageReceiver. I always encountered the "operation invalid whilst session is using asynchronous delivery". This particular defect record (MULE-3279) relates to that behavior in our receiver (this is what was discussed in your case #1504). The issue you are reporting now appears to be isolated to the custom code in BusTransactionCompliantJmsMessageReceiver.

Can you clarify the purpose of this custom receiver, and how it differs from the functionality offered in MultiConsumerJmsMessageReceiver? Have you confirmed that the flow you were attempting to achieve with this custom receiver can't be achieved with MultiConsumerJmsMessageReceiver?

If you need assistance customizing our code to meet your needs, I would recommend discussing a possible engagement with our consulting team. They have extensive expertise with customizations of all the aspects of the ESB product (connectors, components, etc.). I'll discuss this with Ross and others here internally,

Unfortunately, I can't attach files to a closed defect record, but I've pasted my simple test configuration for this issue below, which uses our standard receiver:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mule-configuration PUBLIC "-//MuleSource //DTD mule-configuration XML V1.0//EN" "http://mule.mulesource.org/dtds/mule-configuration.dtd">
<mule-configuration id="MasterData" version="1.0">

<mule-environment-properties>
<!-- threading-profile maxThreadsActive="50" maxThreadsIdle="50"
maxBufferSize="500" poolExhaustedAction="WAIT"/>
<pooling-profile exhaustedAction="WAIT" maxActive="50" maxIdle="50"
maxWait="-1" initialisationPolicy="INITIALISE_ALL" / -->
</mule-environment-properties>

<container-context className="org.mule.extras.spring.SpringContainerContext">
<properties>
<property name="configFile" value="C:\Documents and Settings\angelo\Desktop\Case Folders\1483\conf\spring-remote-context.xml"/>
</properties>
</container-context>

<connector name="SystemStreamConnector" className="org.mule.providers.stream.SystemStreamConnector">
<properties>
<property name="promptMessage" value="Please enter something: "/>
<property name="messageDelayTime" value="1000"/>
</properties>
</connector>

<connector name="mqConnector" className="org.mule.providers.jms.websphere.WebsphereJmsConnector">
<properties>
<property name="eagerConsumer" value="false"/>
<property name="username" value=""/>
<property name="password" value=""/>
<property name="specification" value="1.0.2b"/>
<property name="maxRedelivery" value="2" />
<property name="numberOfConcurrenTransactedReceivers" value="96"/>
<property name="maxDispatchersActive" value="50"/>

<container-property name="connectionFactory" reference="devQpidJmsConnectionFactory" required="true"/>
<map name="serviceOverrides">
<property name="message.receiver" value="org.mule.providers.jms.MultiConsumerJmsMessageReceiver"/>
<property name="transacted.message.receiver" value="org.mule.providers.jms.MultiConsumerJmsMessageReceiver"/>
</map>

</properties>
<connection-strategy className="org.mule.providers.SimpleRetryConnectionStrategy">
<properties>
<property name="retryCount" value="-1"/>

<property name="frequency" value="5000"/>
</properties>
</connection-strategy>
</connector>

<model name="bus-instance">

<mule-descriptor name="BridgeUMO" implementation="org.mule.components.simple.BridgeComponent">

<inbound-router>
<endpoint address="stream://System.in" connector="SystemStreamConnector" />
</inbound-router>
<outbound-router>
<router className="org.mule.routing.outbound.OutboundPassThroughRouter">
<endpoint address="jms://mule.request?targetClient=1" connector="mqConnector">
</endpoint>
</router>
</outbound-router>
</mule-descriptor>

<mule-descriptor name="GetUMO" implementation="org.mule.components.simple.BridgeComponent">
<inbound-router>
<endpoint address="jms://mule.request?targetClient=1" connector="mqConnector">
<transaction action="ALWAYS_BEGIN" factory="org.mule.providers.jms.JmsTransactionFactory" />
</endpoint>

</inbound-router>

<outbound-router>
<router className="org.mule.routing.outbound.MulticastingRouter">
<endpoint address="jms://mule.reply?targetClient=1" connector="mqConnector">
<transaction action="ALWAYS_JOIN" factory="org.mule.providers.jms.JmsTransactionFactory" />
</endpoint>
<endpoint address="jms://muleunittest.reply?targetClient=1" connector="mqConnector">
<transaction action="ALWAYS_JOIN" factory="org.mule.providers.jms.JmsTransactionFactory" />
</endpoint>
</router>
</outbound-router>

<pooling-profile exhaustedAction="WAIT" maxActive="50" maxIdle="50" maxWait="-1" initialisationPolicy="INITIALISE_ALL" />

</mule-descriptor>

</model>
</mule-configuration>


Hassan Sajjad added a comment - 09/Jul/08 04:38 AM

Angelo, re your question: "Can you clarify the purpose of this custom receiver, and how it differs from the functionality offered in MultiConsumerJmsMessageReceiver? Have you confirmed that the flow you were attempting to achieve with this custom receiver can't be achieved with MultiConsumerJmsMessageReceiver? "

a: BusTransactionCompliantJmsMessageReceiver currently extends org.mule.providers.jms.JmsMessageReceiver, however, once we have the doThreading issue resolved (as per case 00001483) we will
use / extend from the MultiConsumerJmsMessageReceiver instead. Using MultiConsumerJmsMessageReceiver as of now gives the 'Not Connected' issue at startup, so the current setup is primarily to avoid any issues and be able to continue with our upgrade testing....

I have forwarded you the code for BusTransactionCompliantJmsMessageReceiver as I could not attach it to the jira. BusTransactionCompliantJmsMessageReceiver delegates everything to the parent Mule classes and has only one small bespoke functionality:

"if (tx instanceof JmsTransaction || tx instanceof BusTransaction)"

Note: the only change (addition) is '|| tx instanceof BusTransaction', to allow our transaction class to also bind.

One option is that we can defer this testing now and re-test once the patch for o/s issues arrive. However, we will still get the transaction binding issue due to the api changes in 1.4.4, as reported on case # 00001618 (see more details). As a fallback we would have to use a custom functionality like BusTransactionCompliantJmsMessageReceiver!!

In 1.4.4 JmsMessageReceiver.JmsWorker (subclass) binds the incoming JMS transactions with an explicit check on the org.mule.providers.jms.JmsTransaction instances. This is problematic for us as we wrap JmsTransaction with our own custom class.

JmsMessageReceiver.JmsWorker.bindTransaction method:

protected void bindTransaction(UMOTransaction tx) throws TransactionException
{
if(tx instanceof JmsTransaction)

{ tx.bindResource(connector.getConnection(), session); }

else ....


Hassan Sajjad added a comment - 09/Jul/08 01:44 PM
Also would be good if you can discuss any alternative approach to do this as ideally we would not be keen on maintaining our own Mule extension i.e. BusTransactionCompliantJmsMessageReceiver, with your Engineers.

Angelo Bresci added a comment - 09/Jul/08 04:40 PM
Hassan,

Thank you for the additional information. We do plan to fix the issue with doThreading in the upcoming patch, and at that point you should definitely be using the MultiConsumerJmsMessageReceiver (or at least extending that class).

With regards to your question about alternative approaches, I've logged case 1642 to track this. I am inquiring with our engineers. I suspect it's not possible out of the box, but will see what comes back. If necessary, I will file an enhancement request to add more flexibility to receivers in future versions, so other transaction classes can be supported.