Closed krpors closed 1 month ago
I noticed that one other possible fix is to execute the Pong processing in a transaction like so in EbMSMessageProcessor.java
.
ebMSDAO.executeTransaction(() -> pongProcessor.processPong((EbMSPong)message));
This is of course not the correct place (because there may not be a transaction manager in use).
hi,
sorry for the late response. I will take a look at it. It should not be necessary that the pong is part of a transaction. So maybe removing the transaction could solve it, but I have to take a better look at it.
kind regards, Edwin
No problem, thank you for your time.
I also noticed that sending an (asynchronous) Ping
has the same behaviour (using Atomikos as a tx-manager). It can be traced back to the following piece of code in JMSDeliveryManager.java
:
return Optional.ofNullable(
(EbMSResponseMessage)jmsTemplate
.receiveSelectedAndConvert(JMS_DESTINATION_NAME, "JMSCorrelationID='" + messageHeader.getMessageData().getMessageId() + "'"));
The end result is that a Ping
is sent successfully using the HTTP client, but waiting for the Pong
reply (using the jmsTemplate
) results in the same JTA exception described above. Once again, wrapping it in a transaction using ebmsDAO.executeTransaction(...)
fixes the problem (but obv only when a transaction manager is active).
what call should be wrapped than? I was wondering, because the processPing returns a result.
Btw, I committed a fix on the branch fix2.
This issue is fixed in release 2.19.4
Hi @eluinstra thanks for the fix. I don't see a tag for 2.19.4 yet, can I use this version, or is there still more changes coming?
I just tagged and released it.
Hi,
We've come to an issue with receiving an EbMS
Pong
. The message is received properly, validated and all that, but in the end the client receives anHTTP 500
. With some trickery, the following logs could be observed:I was able to reproduce this, using this fork.
Steps to reproduce:
dev-2.19.x
docker run --name some-postgres -e POSTGRES_PASSWORD=ebms -e POSTGRES_USER=ebms -p 5432:5432 -d postgres
nl/clockwork/ebms/EbMSServer.java
.From
andTo
PartyIds in./debugging/pong.xml
, according to the CPA./debugging/send_pong.sh
The
JMSDeliveryManager
should output the stacktrace above.Possible fix
I was able to fix the error by making two changes:
JMSConfig.java
, changeresult.setLocalTransactionMode(false);
toresult.setLocalTransactionMode(true);
/src/test/resources/nl/clockwork/ebms/default.properties
, I changed the JMS broker URL to include an extra property as follows:jms.brokerURL=vm://localhost?jms.xaAckMode=1
. This is according to this JIRA issue.I am unaware though if the above fix is a proper one, since the
ConnectionFactory
is used in other places.Any thoughts? Thanks!