You are viewing a plain text version of this content. The canonical link for it is here.
Posted to sandesha-dev@ws.apache.org by Amila Suriarachchi <am...@gmail.com> on 2008/12/25 08:11:17 UTC

Working Sandesha2 with synapse NIO transport.

I recently try to work synapse NIO transport with the sandesha2 and
got this problem.

RequestResponseTransport awaitResponse() method has the following java doc.

/**
     * Pause execution and wait for a response message to be ready.  This will
     * typically be called by the transport after a message has been paused and
     * will cause the transport to block until a response message is ready to be
     * returned.  This is required to enable RM for in-out MEPs over a
     * request/response transport; without it the message would be
paused and the
     * transport would simply ack the request.
     *
     * @throws InterruptedException
     */
    public void awaitResponse() throws InterruptedException, AxisFault;

According to this a transport goes to a WAIT state if AxisEngine
returns an InvocationResponse.SUSPEND

Synapse sender worker has this code.

// If we are anonymous, and this is not a makeConnection, then we must
have a transport waiting
			if((toEPR==null || toEPR.hasAnonymousAddress()) &&
			   (makeConnection == null || !makeConnection.booleanValue()) &&
			   (t == null ||
!t.getStatus().equals(RequestResponseTransportStatus.WAITING))) {
				
				// Mark this sender bean so that we know that the transport is
unavailable, if the
				// bean is still stored.
				SenderBean bean = senderBeanMgr.retrieve(senderBean.getMessageID());
				if(bean != null && bean.isTransportAvailable()) {
					bean.setTransportAvailable(false);
					senderBeanMgr.update(bean);
				}
				
				// Commit the update
				if(transaction != null && transaction.isActive()) transaction.commit();
				transaction = null;
				
				if (log.isDebugEnabled())
					log.debug("Exit: SenderWorker::run, no response transport for
anonymous message");
				return;
			}


So this expects a RequestResponseTransport wait for an annonymous
response. But with Sandesha2 an annonymous response is send using the
same thread it receives the request.
So the original request as not quit from the AxisEngine and hence
awaitResponse method has not been called. So Sandesha2 does not sends
the response.

This problem has been solved in AxisServlet and SimpleHttp transports
by setting status initially to WAIT. But Synapse NIO transport sets it
to INITIAL.

I reported this in synapse[1] but seems that they feel it is correct.

When I change the synapse NIO transport status to WAIT it works fine
with Sandesha2.

Any thoughts?

thanks,
Amila.

[1] https://issues.apache.org/jira/browse/SYNAPSE-493


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org