0

Is there any way to get resource uri-template value from MessageContext to be used in custom Handler?

For example, if the api synapse config is

...
<api xmlns="http://ws.apache.org/ns/synapse"
         name="something"
         context="something"
         version="something"
         version-type="context">
       <resource methods="GET" uri-template="/?test={test2}" faultSequence="fault">
...

how can i get the '/?test={test2}' string into my custom handler.

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
rucciva
  • 157
  • 1
  • 1
  • 11

1 Answers1

1

you could use following inside your handler

String resourceString = (String) synCtx.getProperty("API_ELECTED_RESOURCE");

where synCtx is the MessageContext

Chamila Adhikarinayake
  • 3,588
  • 5
  • 25
  • 32