Hi Riyadh,
Well, the clone mediator is same as send in the operation nature (what I
just explained), because it injects the cloned messages to synapse in
parallel (asynchronously) and those cloned messages are completely
independent, and hence this requirement is a little hard to achieve.
Let me try to explain one possible but hard to implement solution. You
will have to write a blocking state full mediator, and the messages
which arrives this mediator is stored inside a map indexed with the the
message number and the parent message id in to a message group (having
the same parent message id), and wait till that mediator receives all
the messages before letting the message to go out from that mediator. At
the same time when ever a message has been received for mediation this
should check for the completion of a message group.
This mediator has to be put just before the send mediator in all the
sequences, to ensure all the messages have been reached this mediator
before releasing the messages to send. There are two properties in the
cloned messages that will be help full in achieving this;
messageSequence ==> which will be something like 1/4, 3/4, etc...
($message_number/$number_of_cloned_messages)
aggregateCorelation ==> the message id of the parent message from which
these messages are cloned
You may have a look at the aggregate mediator code which does something
similar. You will need to specify a timeout for a message group so that
the mediator will only wait only for that time period and discards the
whole message group.
Even then you could not detect sending channel failures. Obviously it is
not possible to assure your requirement if one message fails in the
transport channel of the sending process because when ever that
particular message fails in the transport some of the messages has been
already sent to the recipient.
If not you could write your own clone mediator which does the mediation
synchronously and assures the sending of the messages at the end of
mediation of cloned messages.
If you need further clarifications on this please do not hesitate to
bother me :-)
Thanks,
Ruwan
Riyadh wrote:
Hi,
Thanks for your reply.
let me specify our requirements:
We have a clone mediator which clones the same message to a number
of sequence mediators where each sequence mediator contains a set of
mediators. Each sequence has a send mediator at the end in the
sequence to send the message to a service.
At the end of clone we want to determine that to which services the
message was sent and we have to capture the list of services to whom
the message was sent before logging it. We will use our custom log
mediator to log it.
Now if any sequence in the clone fails, the message is not sent to any
service. How do i capture this at the end of clone?
I hope i could explain what i want.
Is the usage of transport helpful here? can you just explain a bit
about it?
Thank you.
Riyadh
On Mon, Mar 17, 2008 at 3:31 PM, Ruwan Linton <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi Riyadh,
Riyadh wrote:
> Hi Paul,
>
> Thanks for your reply.
> i can see that using the fault sequence i can capture the
failure of
> a message continuation but i rather need to capture the successful
> mediation.
>
> is there any variable or property which is set for continuation
of the
> mediator and i can read the value of the variable in a subsequent
> mediator.
Well, for the moment there is no such property, but even if we put a
property to check the successful continuation, when it comes to
mediators like send, this value does not have much value, because send
is asynchronous inside the ESB, so that you want be able to detect the
successful delivery of a message. What you can check is whether the
message has been submitted to the transport for sending
successfully...???
If this is the case, even then you don't need this property
because you
get to the point where you are now in mediation because all the
already
executed mediators are successful in there mediation....
Can you please elaborate on your exact requirements so that we will be
able to help you..
Thanks,
Ruwan
_______________________________________________
Esb-java-dev mailing list
[email protected] <mailto:[email protected]>
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
------------------------------------------------------------------------
_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev