2

I try to create wso2 jms endpoint and the code is,

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="canary-v1-jms-internal-topic-endpoint" xmlns="http://ws.apache.org/ns/synapse">
    <address uri="jms:/canary-internal-topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=topic">
        <suspendOnFailure>
            <initialDuration>-1</initialDuration>
            <progressionFactor>1</progressionFactor>
        </suspendOnFailure>
        <markForSuspension>
            <retriesBeforeSuspension>0</retriesBeforeSuspension>
        </markForSuspension>
    </address>
</endpoint>

but here i need to change that uri by getting value from system variable. so i decide to replace tcp://localhost:61616 with $SYSTEM:TCP. The code is,

<address uri="jms:/canary-internal-topic?transport.jms.ConnectionFactoryJNDIName=TopicConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=$SYSTEM:TCP&amp;transport.jms.DestinationType=topic">

but its not working. can anyone give me the solution for it.

1
  • What exactly do you mean by "its not working"? Apr 30, 2021 at 13:11

2 Answers 2

2

you can use REST_URL_POSTFIX for append required parts to end of the url using this.

0

You can inject parameters as Environment Variables and using Configuration Files[1]. As your requirement is Injecting Parameters as Environment Variables, First you need to export the environment variable as below.

export backendEP=http://localhost:8280/services/Version

And Define the endpoint as below.

<endpoint name="backendEP">
         <address uri="$SYSTEM:backendEP"/>
</endpoint>

Sample proxy service:

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="InjectProxy" startOnLoad="true" statistics="disable" trace="disable" transports="http,https">
<target>
    <inSequence>
        <call>
    <endpoint name="backendEP">
        <address uri="$SYSTEM:backendEP"/>
    </endpoint>
        </call>
        <respond/>
    </inSequence>
</target>
<description/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.