Is there a way to set the property inside class mediator with transport scope?

42 views Asked by At

I have setup a VFS proxy, where I am invoking a Restapi inside a class mediator. Now if I get error such as the target api is not available at the moment I want to pause the proxy service from further processing the message or polling another file untill the target api is back online.

I have tried setting the property "transport.vfs.ReplyFile" to false with scope=transport

But I am not able to do it inside of class mediator

1

There are 1 answers

3
ycr On

What you are trying to do is not clear to me. But to answer the question you can set a transport scope property(Transport header) within the class mediator like below.

Map<String,Object> transportHeaders = (Map<String, Object>) ((Axis2MessageContext)messageContext)
                .getAxis2MessageContext().getProperty("TRANSPORT_HEADERS");
transportHeaders.put("SomeHeader", "Some value");