[JBoss ESB Development] - Setting http client properties for HttpRouter from java code
by tomas tomas
tomas tomas [http://community.jboss.org/people/tomis] created the discussion
"Setting http client properties for HttpRouter from java code"
To view the discussion, visit: http://community.jboss.org/message/644099#644099
--------------------------------------------------------------
Hi all,
Currently I'm using jbossesb 4.4.
When using xml based configuration I can use the following XML to configure HttpRouter
-----------------------------------------------
<action name="httprouter" class="org.jboss.soa.esb.actions.routing.http.HttpRouter">
<property name="endpointUrl" value=" http://localhost:9433/x/y http://localhost:9433/x/y">
<http-client-property name="file"
value="/META-INF/HttpRouter.properties" />
</property>
<property name="method" value="POST" /> <!-- Currently only supports GET or POST - easy to add more! -->
<property name="responseType" value="STRING" /> <!-- Response should be set back on message as STRING or BYTES - default
STRING -->
<property name="headers"> <!-- Supports setting of arbitrary request headers -->
<header name="blah" value="blahval" />
</property>
</action>
-----------------------------------------------
How all this can be done in java code?
-----------------------------------------------
ConfigTree c = _config.cloneObj();
c.setAttribute("endpointUrl", " http://localhost:9433/x/y http://localhost:9433/x/y");
c.setAttribute("method", "POST");
c.setAttribute("responseType", "STRING");
??????????? How to set http client properties like connection timeout (http.connection.timeout), socket timeout (http.socket.timeout) and etc.. for HttpRouter?
HttpRouter router = new HttpRouter(c);
Message m = router.process(message);
-----------------------------------------------
Thanks in advance!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/644099#644099]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
12 years, 12 months