You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Florin Bejinaru <fl...@gmail.com> on 2009/10/19 23:24:09 UTC

Clone Mediator endpoint

I have to specify a "to" address of a clone mediator, but I need to do it
dynamically so I thought that  :
<clone>
    <target endpoint="endpoint/dynamic_endpoint.xml">
          <sequence>...

should do the trick, but I am getting an exception when trying to <send />
in the clone mediator, how can I set the endpoint of the clone mediator so
that it points to an external endpoint file.

I should also mention that I am using other <endpoint
key="endpoint/other_dynamic_endpoint.xml"/> endpoints just fine so it's not
the endpoints xml files.

Re: Clone Mediator endpoint

Posted by Florin Bejinaru <fl...@gmail.com>.
Thank you for your reply, unfortunately I had to switch to a more pressing
project, so it will be some time before I have a chance to test this.

Thank you,
Florin

2009/10/20 Ruwan Linton <ru...@gmail.com>

> Yes, Hiranya is correct on this...
>
> The clone mediator target mediates the message using the specified sequence
> and then send the message using the specified endpoint.
>
> So you shouldn't try to send the message in the target sequence.
>
> Thanks,
> Ruwan
>
> On Tue, Oct 20, 2009 at 7:40 PM, Hiranya Jayathilaka
> <hi...@gmail.com>wrote:
>
> > On Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru
> > <fl...@gmail.com>wrote:
> >
> > > The Error I am getting is :
> > >
> > > 2009-10-20 00:33:50,308 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1]
> > ERROR
> > > ClientUtils The system cannot infer the transport information from the
> > > /services/Event URL.
> > > 2009-10-20 00:33:50,312 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1]
> > ERROR
> > > Axis2Sender Unexpected error during sending message out
> > > org.apache.axis2.AxisFault: The system cannot infer the transport
> > > information from the /services/Event URL.
> > >
> > > which I don't get if I set the "to" attribute on the target element.
> > >
> >
> > Looking at the source code of the CloneMediator and the Target class, I
> > can't see why this approach doesn't work. It should work without any
> > issues.
> > Here's the relevant code segment from the Taget class.
> >
> >        *if (sequence != null) {
> >            synCtx.getEnvironment().injectAsync(synCtx, sequence);
> >        } else if (sequenceRef != null) {
> >            SequenceMediator refSequence = (SequenceMediator)
> > synCtx.getSequence(sequenceRef);
> >            if (refSequence != null) {
> >                synCtx.getEnvironment().injectAsync(synCtx, refSequence);
> >            }
> >        } else if (endpoint != null) {
> >            endpoint.send(synCtx);
> >        } else if (endpointRef != null) {
> >            Endpoint epr =
> > synCtx.getConfiguration().getEndpoint(endpointRef);
> >            if (epr != null) {
> >                epr.send(synCtx);
> >            }
> >        }*
> >
> > Can you please verify that Synapse doesn't send any messages to the
> > endpoint
> > you have specified? Note that when an endpoint is refered by the target
> it
> > tries to send the message to that endpoint. Therefore putting a send
> > mediator in the clone mediator target is not required and that could even
> > cause issues. May be the clone mediator actually sends messages to the
> > specified endpoint and what is failing is the send mediator which tries
> to
> > send the message to the 'To' address set in the message.
> >
> > Thanks,
> > Hiranya
> >
> >
> > --
> > Hiranya Jayathilaka
> > Software Engineer;
> > WSO2 Inc.;  http://wso2.org
> > E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
>
>
> --
> Ruwan Linton
> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
> email: ruwan@wso2.com; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>

Re: Clone Mediator endpoint

Posted by Ruwan Linton <ru...@gmail.com>.
Yes, Hiranya is correct on this...

The clone mediator target mediates the message using the specified sequence
and then send the message using the specified endpoint.

So you shouldn't try to send the message in the target sequence.

Thanks,
Ruwan

On Tue, Oct 20, 2009 at 7:40 PM, Hiranya Jayathilaka
<hi...@gmail.com>wrote:

> On Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru
> <fl...@gmail.com>wrote:
>
> > The Error I am getting is :
> >
> > 2009-10-20 00:33:50,308 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1]
> ERROR
> > ClientUtils The system cannot infer the transport information from the
> > /services/Event URL.
> > 2009-10-20 00:33:50,312 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1]
> ERROR
> > Axis2Sender Unexpected error during sending message out
> > org.apache.axis2.AxisFault: The system cannot infer the transport
> > information from the /services/Event URL.
> >
> > which I don't get if I set the "to" attribute on the target element.
> >
>
> Looking at the source code of the CloneMediator and the Target class, I
> can't see why this approach doesn't work. It should work without any
> issues.
> Here's the relevant code segment from the Taget class.
>
>        *if (sequence != null) {
>            synCtx.getEnvironment().injectAsync(synCtx, sequence);
>        } else if (sequenceRef != null) {
>            SequenceMediator refSequence = (SequenceMediator)
> synCtx.getSequence(sequenceRef);
>            if (refSequence != null) {
>                synCtx.getEnvironment().injectAsync(synCtx, refSequence);
>            }
>        } else if (endpoint != null) {
>            endpoint.send(synCtx);
>        } else if (endpointRef != null) {
>            Endpoint epr =
> synCtx.getConfiguration().getEndpoint(endpointRef);
>            if (epr != null) {
>                epr.send(synCtx);
>            }
>        }*
>
> Can you please verify that Synapse doesn't send any messages to the
> endpoint
> you have specified? Note that when an endpoint is refered by the target it
> tries to send the message to that endpoint. Therefore putting a send
> mediator in the clone mediator target is not required and that could even
> cause issues. May be the clone mediator actually sends messages to the
> specified endpoint and what is failing is the send mediator which tries to
> send the message to the 'To' address set in the message.
>
> Thanks,
> Hiranya
>
>
> --
> Hiranya Jayathilaka
> Software Engineer;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>



-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Re: Clone Mediator endpoint

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru
<fl...@gmail.com>wrote:

> The Error I am getting is :
>
> 2009-10-20 00:33:50,308 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1] ERROR
> ClientUtils The system cannot infer the transport information from the
> /services/Event URL.
> 2009-10-20 00:33:50,312 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1] ERROR
> Axis2Sender Unexpected error during sending message out
> org.apache.axis2.AxisFault: The system cannot infer the transport
> information from the /services/Event URL.
>
> which I don't get if I set the "to" attribute on the target element.
>

Looking at the source code of the CloneMediator and the Target class, I
can't see why this approach doesn't work. It should work without any issues.
Here's the relevant code segment from the Taget class.

        *if (sequence != null) {
            synCtx.getEnvironment().injectAsync(synCtx, sequence);
        } else if (sequenceRef != null) {
            SequenceMediator refSequence = (SequenceMediator)
synCtx.getSequence(sequenceRef);
            if (refSequence != null) {
                synCtx.getEnvironment().injectAsync(synCtx, refSequence);
            }
        } else if (endpoint != null) {
            endpoint.send(synCtx);
        } else if (endpointRef != null) {
            Endpoint epr =
synCtx.getConfiguration().getEndpoint(endpointRef);
            if (epr != null) {
                epr.send(synCtx);
            }
        }*

Can you please verify that Synapse doesn't send any messages to the endpoint
you have specified? Note that when an endpoint is refered by the target it
tries to send the message to that endpoint. Therefore putting a send
mediator in the clone mediator target is not required and that could even
cause issues. May be the clone mediator actually sends messages to the
specified endpoint and what is failing is the send mediator which tries to
send the message to the 'To' address set in the message.

Thanks,
Hiranya


-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: Clone Mediator endpoint

Posted by Florin Bejinaru <fl...@gmail.com>.
The Error I am getting is :

2009-10-20 00:33:50,308 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1] ERROR
ClientUtils The system cannot infer the transport information from the
/services/Event URL.
2009-10-20 00:33:50,312 [10.9.4.40-Florin-9Aug2009] [SynapseWorker-1] ERROR
Axis2Sender Unexpected error during sending message out
org.apache.axis2.AxisFault: The system cannot infer the transport
information from the /services/Event URL.

which I don't get if I set the "to" attribute on the target element.

Re: Clone Mediator endpoint

Posted by Ruwan Linton <ru...@gmail.com>.
Your approach seems to be correct and it should work, can you please attach
the error log that you are getting with this configuration?

Also do you have the registry declaration in the synapse.xml, I assume yes,
since you have other dynamic endpoints working. You may also attach the
synapse.xml configuration so that I can reproduce the issue if there are
any.

Thanks,
Ruwan

On Tue, Oct 20, 2009 at 2:54 AM, Florin Bejinaru
<fl...@gmail.com>wrote:

> I have to specify a "to" address of a clone mediator, but I need to do it
> dynamically so I thought that  :
> <clone>
>    <target endpoint="endpoint/dynamic_endpoint.xml">
>          <sequence>...
>
> should do the trick, but I am getting an exception when trying to <send />
> in the clone mediator, how can I set the endpoint of the clone mediator so
> that it points to an external endpoint file.
>
> I should also mention that I am using other <endpoint
> key="endpoint/other_dynamic_endpoint.xml"/> endpoints just fine so it's not
> the endpoints xml files.
>



-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com