locked
Unidirectional messages RRS feed

  • Question

  • Hello,

     

    Does the DSS infrastructure support unidirectional operations ?   where no response is expected by the service for a message sent to it on its operations port.

     

    There can be an implicit understanding that a particular operation is unidirectional, i.e the service will not send a response on the response port and so the user will not listen for it. Also, this can be encoded in the operation body. However, I am looking for a more general solution.

     

    One way I tried is to create an operation object with a null response port and send it to the service.  Now a handler can check for whether the response port is null and accordingly send a response.

     

    CustomOperation m = new CustomOperation(new CustomOperationType(), null);

     

    However what I find is that when the operation arrives at the target service, the run-time creates a response port when de-serializing and transforming the operation, so when the handler runs it finds a non-null response port.

     

    Thanks

     

    Monday, August 6, 2007 7:54 AM

Answers

  •  

    It turns out that when you set a port to null, on an outbound Dssp operation, indeed the DSS infra marks it as OneWay. When this operation is received on the remote side, we still allocate a response port however to not burden the "server" with caring, every time, if there is a response or not. Your service receiving the operation can still reply, but the moment it does we throw it away and never bother to sent it across the network.

     

    If you really need to know that no reply is needed, for any operation type (ones you dont control), you can always add a header to your outbound operation. Then the service receiving it, can check for the presence of the header in operation.Headers, and  if its there, it does not even bother to formulate a response.

     

    g

    Tuesday, August 7, 2007 12:36 AM

All replies

  •  

    It turns out that when you set a port to null, on an outbound Dssp operation, indeed the DSS infra marks it as OneWay. When this operation is received on the remote side, we still allocate a response port however to not burden the "server" with caring, every time, if there is a response or not. Your service receiving the operation can still reply, but the moment it does we throw it away and never bother to sent it across the network.

     

    If you really need to know that no reply is needed, for any operation type (ones you dont control), you can always add a header to your outbound operation. Then the service receiving it, can check for the presence of the header in operation.Headers, and  if its there, it does not even bother to formulate a response.

     

    g

    Tuesday, August 7, 2007 12:36 AM
  • Hi George,

     

    Thanks for the clarification. It will work just fine.  The service handler always responds to the message. It is the senders choice as to whether it wants a response or not, using a null response port for the latter case.

     

    Tuesday, August 7, 2007 3:26 AM