Hi,
I have to send a SOAP message from one system ("client") to another one
("server"). As the network
between the client and the server is not reliable, I thought that I could use a
JMS queue to send
the messages and to add reliability. I am not quite sure if the following
problem is caused by CXF
or by ActiveMQ.
So I am starting an in-process ActiveMQ broker on the client and one on the
server. The client
broker connects to the server broker via TCP (<networkConnector
uri="static:(tcp://myserver:61636)"), both client and server use a
ConnectionFactory which connects
to the respective local broker via the "vm://" transport. So the setup looks
like this:
CXF client --> ConnectionFactory --> Local ActiveMQ Broker (on the client) -->
TCP -->
--> ActiveMQ Broker (on the server) --> ConnectionFactory --> CXF server
When I send a SOAP message to the server, the server receives the message just
fine. However, right
after that I get the following exception in the server when it tries to send
its response:
org.springframework.jms.InvalidDestinationException: Cannot publish to a
deleted Destination:
temp-queue://ID:McQueen-52950-1295274779053-3:1:1; nested exception is
javax.jms.InvalidDestinationException: Cannot publish to a deleted
Destination:
temp-queue://ID:McQueen-52950-1295274779053-3:1:1
...
at
org.apache.cxf.transport.jms.JMSDestination.sendExchange(JMSDestination.java:304)
at
org.apache.cxf.transport.jms.JMSOutputStream.doClose(JMSOutputStream.java:56)
at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:185)
It looks like if the server broker cannot find the temporary queue which was
created by the client
for the response.
Do you have any hints for me of what I am doing wrong? I am using CXF 2.3.1 and
ActiveMQ 5.4.2.
Interestingly, it works just fine, if I point the ConnectionFactory of the
client directly to the
broker that is running on the server (so that I am using only one single
broker). Of course, this is
not reliable, because if the network fails the client cannot connect to a
broker running on the server.
It also works just fine, if I mark the SOAP message with a "@Oneway" annotation.
Thanks,
Martin