[ESB] What does it mean by an anonymous endpoint or a sequence
While I was mapping automated test cases with manual test cases in WSO2 test case repository I came across the terms anonymous endpoint and anonymous sequence. I’m writing this brief explanation to clarify the difference between the terms anonymous, registry and named.
Anonymous Endpoint/ Anonymous Sequence:-
This is when the endpoint or the sequence is defined inside your Synapse configuration itself. That means the endpoint or the sequence is not created in a different location such as registry or as a separate synapse config. For example, refer to the configuration below. The following endpoint is an anonymous endpoint because it is defined inside the main synapse config rather than creating a registry endpoint or a named endpoint which is saved in a separate config that can be refereed to, from other places.
<sequence name="iterateMessages2">
<iterate id="iterate1" expression="//m0:getQuote/m0:request"
preservePayload="true" attachPath="//m0:getQuote" xmlns:m0="http://services.samples">
<target sequence="anon">
<sequence>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" />
</endpoint>
</send>
</sequence>
</target>
</iterate>
</sequence>
Registry Endpoint/Sequence:-
As you can see, registry endpoint/sequence are defined in registry and it can be referred from other synapse configs as displayed below.
<sequence name="iterateMessages6">
<iterate id="iterate1" expression="//m0:getQuote/m0:request"
preservePayload="true" attachPath="//m0:getQuote" xmlns:m0="http://services.samples">
<target>
<sequence>
<send>
<endpoint key="gov:/myEndpoint/iterateEndpoint" />
</send>
</sequence>
</target>
</iterate>
</sequence>
Named Endpoint/Sequence:-
Named endpoint or a sequence means the config is created as a ESB artifact. Please refer to the example below. “ep1” is a named endpoint.
<sequence name="iterateMessages5">
<iterate id="iterate1" expression="//m0:getQuote/m0:request"
preservePayload="true" attachPath="//m0:getQuote" xmlns:m0="http://services.samples">
<target>
<sequence>
<send>
<endpoint key="ep1" />
</send>
</sequence>
</target>
</iterate>
</sequence>
Hope this was useful to understand the difference between anonymous, registry and named endpoints/sequences.