|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Clone Mediator endpointI 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 endpointYour 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 <florinbejinaru@...>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@...; cell: +94 77 341 3097 blog: http://ruwansblog.blogspot.com |
|
|
Re: Clone Mediator endpointThe 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. <endpoint xmlns="http://ws.apache.org/ns/synapse"> <address uri="http://192.168.88.1:8080/EventService/services/Event"/> </endpoint> <!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more contributor license agreements. See the NOTICE file ~ distributed with this work for additional information ~ regarding copyright ownership. The ASF licenses this file ~ to you under the Apache License, Version 2.0 (the ~ "License"); you may not use this file except in compliance ~ with the License. You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, ~ software distributed under the License is distributed on an ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the License for the ~ specific language governing permissions and limitations ~ under the License. --> <!-- A simple Synapse configuration --> <definitions xmlns="http://ws.apache.org/ns/synapse"> <registry provider="org.apache.synapse.registry.url.SimpleURLRegistry"> <parameter name="root">file:repository/conf/resources/</parameter> <!-- The cacheableDuration parameter means that the registry will update itself every 15 seconds if neccesary --> <parameter name="cachableDuration">15000</parameter> </registry> <in> <!-- Log all messages passing through --> <log level="full"/> <!-- ensure that the default configuration only sends if it is one of samples --> <!-- Otherwise Synapse would be an open proxy by default (BAD!) --> <!--<filter source="get-property('To')" regex="http://192.168.239.128:9000.*">--> <!-- Send the messages where they have been sent (i.e. implicit "To" EPR) --> <!--<send/>--> <!--</filter>--> <filter source="get-property('To')" regex=".*/Event.*"> <clone continueParent="true"> <!--<target to="http://192.168.88.1:8080/EventService/services/Event/">--> <target endpoint="endpoint/monitor_dynamic_endpoint.xml"> <!--<target>--> <sequence> <property action="set" name="service-port" value="8080"/> <!--<class name="JavaMediator"/>--> <!-- The following filter sequence is stopped and moved to a central host --> <!--<sequence key="localSequence"/>--> <sequence key="sequence/main_dynamic_seq.xml"/> <!--<send/>--> </sequence> <!-- The endpoint for the clone mediator isn't needed apparently --> <!--<endpoint> <address uri="http://192.168.239.1:8080/EventService/services/Event"/> </endpoint>--> <!--<send/>--> <!--<outsequence> <class name="JavaMediator"/> <send/> </outsequence>--> </target> </clone> <!-- To distinguish the local ISM response from other service responses we set the "service-port" property --> <property action="set" name="service-port" value="9000"/> <send> <!-- Send nu poate trimite decat unui singur endpoint in cazul de fata trimite doar primului endpoint intalnit, de aceea s-a folosit mediatorul "clone" mai sus --> <!-- The second Endpoint : The local pvServer ISM --> <!--<endpoint> <address uri="http://192.168.88.129:9000/services/Event"/> </endpoint>--> <endpoint key="endpoint/ism_dynamic_endpoint.xml"/> </send> <drop/> </filter> </in> <out> <log level="full"/> <!-- None of these previous filters seemed to do the job, but the last one seems to work just fine, "if something ain't broke..." --> <!--<filter source="get-property('Direction')" regex=".*request.*"> <send/> </filter>--> <!--<filter source="get-property('service-port')" regex=".*9000.*"> <filter source="get-property('Direction')" regex=".*response.*"> <send/> </filter> <send/> </filter>--> <!--<filter source="get-property('direction')" regex=".*response.*"> <drop/> </filter> <send/>--> <filter source="get-property('service-port')" regex=".*9000.*"> <send/> </filter> </out> <!-- The fllowing filter sequences must be stored in a global registry --> <!--<sequence name="localSequence"> <switch source="//Event/EventHeader/name"> <case regex=".*SETUP_PROCESSED.*"> <drop/> </case> <default> <send/> </default> </switch> </sequence>--> </definitions> |
|
|
Re: Clone Mediator endpointOn Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru
<florinbejinaru@...>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@...; Mobile: +94 77 633 3491 Blog: http://techfeast-hiranya.blogspot.com |
|
|
Re: Clone Mediator endpointYes, 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 <hiranya911@...>wrote: > On Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru > <florinbejinaru@...>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@...; 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@...; cell: +94 77 341 3097 blog: http://ruwansblog.blogspot.com |
|
|
Re: Clone Mediator endpointThank 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 <ruwan.linton@...> > 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 > <hiranya911@...>wrote: > > > On Tue, Oct 20, 2009 at 1:41 PM, Florin Bejinaru > > <florinbejinaru@...>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@...; 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@...; cell: +94 77 341 3097 > blog: http://ruwansblog.blogspot.com > |
| Free embeddable forum powered by Nabble | Forum Help |