[ 
https://issues.apache.org/jira/browse/WSCOMMONS-456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12694209#action_12694209
 ] 

Andreas Veithen commented on WSCOMMONS-456:
-------------------------------------------

Actually there is very simple way to make RM work while still allowing for a 
future implementation of asynchronous request-response based on SMTP 
In-Reply-To (and that could rely on existing mechanisms): instead of generating 
a completely new ID as the SMTP message ID, simply use a composite ID: one part 
would be the message ID from the message context and the other part would be 
chosen (either using a sequence or a randomly) to make the SMTP message ID 
unique in the RM case. This would also make debugging easier because you can 
correlate the Axis2 logs with the mail server logs. WDYT?

> Supporting SMTP transport for RM
> --------------------------------
>
>                 Key: WSCOMMONS-456
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-456
>             Project: WS-Commons
>          Issue Type: Improvement
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: patch.txt
>
>
> I recently had some tests for smtp RM support. With the following changes and 
> couple of changes to Sandesha2 trunk I was able to make it working. Here are 
> the smtp transport changes required.
> 1. removing using of same message ID for mail message.
> 2. Setting a RequestResponse transport object and set the status as wait.
> This is the same issue I saw in supporting synapse NIO transport as well.
> Sandesha2 SenderWorker.java 191 has the following code. 
> if (t==null) {
>                               if (op != null)
>                                       inMsg = 
> op.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>                               if (inMsg != null)
>                                       t = (RequestResponseTransport) 
> inMsg.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
>                       }
>                       // 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;
>                       }
> to send a response message this code assumes a RequestResponseTransport 
> object and its state is waiting. 
> So I had to add a new MailRequestResponseTransport class and set it to 
> message context at the receiver. 
> will attach the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to