Nous utilisons des routes camel pour publier des valeurs d'une file d'attente à un point de terminaison http.HTTP Post d'ActiveMQ en utilisant Camel
J'ai réussi à configurer la route à l'aide de http component de camel, mais je n'arrive pas à envoyer le corps du message jms à poster.
Par exemple, mon itinéraire est défini comme ceci:
<route errorHandlerRef="dlc" autoStartup="true" id="route2" xmlns:ns2="http://camel.apache.org/schema/web" xmlns="http://camel.apache.org/schema/spring">
<from uri="activemq:test"/>
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<to uri="http://localhost/tim/camel/" id="to2"/>
</route>
qui se traduit par un POST, mais le corps du message ne se présente pas dans ma chaîne POST (comme print_r'd de _SERVER $):
Array
(
[instance] => local
[HTTP_JMSDELIVERYMODE] => 1
[HTTP_JMSDESTINATION] => queue://test
[HTTP_JMSEXPIRATION] => 0
[HTTP_JMSTYPE] =>
[HTTP_JMSTIMESTAMP] => 1291468702773
[HTTP_JMSPRIORITY] => 0
[HTTP_JMSCORRELATIONID] =>
[HTTP_JMSMESSAGEID] => ID:new-host-3.home-62248-1291465669089-4:3:1:1:4
[HTTP_JMSREDELIVERED] => false
[HTTP_USER_AGENT] => Jakarta Commons-HttpClient/3.1
[HTTP_HOST] => localhost
[HTTP_COOKIE] => $Version=0; PHPSESSID=32aa692c71e1003f2e540c1b80c3b363; $Path=/
[CONTENT_LENGTH] => 44
[CONTENT_TYPE] => text/html
[PATH] => /usr/bin:/bin:/usr/sbin:/sbin
[SERVER_SIGNATURE] => <address>Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2 mod_ssl/2.0.59 OpenSSL/0.9.7l Server at localhost Port 80</address>
[SERVER_SOFTWARE] => Apache/2.0.59 (Unix) PHP/5.2.6 DAV/2 mod_ssl/2.0.59 OpenSSL/0.9.7l
[SERVER_NAME] => localhost
[SERVER_ADDR] => 127.0.0.1
[SERVER_PORT] => 80
[REMOTE_ADDR] => 127.0.0.1
[DOCUMENT_ROOT] => /wufoo/trunk/
[SERVER_ADMIN] => [email protected]
[SCRIPT_FILENAME] => /wufoo/trunk/tim/camel/index.php
[REMOTE_PORT] => 62877
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => POST
[QUERY_STRING] =>
[REQUEST_URI] => /tim/camel/
[SCRIPT_NAME] => /tim/camel/index.php
[PHP_SELF] => /tim/camel/index.php
[REQUEST_TIME] => 1291468702
[argv] => Array
(
)
[argc] => 0
)
Avis REQUEST_METHOD est POST, mais argv ne contient pas de corps de message. En bref, j'ai besoin de transférer le corps du message de la route 'de' à la 'vers' afin qu'il puisse être envoyé comme un POST, mais j'échoue d'une manière ou d'une autre.
Merci d'avance.
Ah génial. Et merci de poster votre conclusion. –
Gareautrain! Merci beaucoup! –