Your flow sends the message received by the inbound HTTP endpoint to both the JMS outbound endpoint and the HTTP outbound endpoint.
So it's expected that the servicesQueue
will contain 6 messages and that at the same time MyServices
gets called 6 times.
Your intention is unclear but if what you wanted instead was to have servicesQueue
act as an intermediary between the inbound and outbound HTTP endpoints then you need to cut your flow in two:
<flow name="AMServiceToQueue">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost"
port="8888" path="AMServices">
<set-property propertyName="Content-Type" value="text/xml"/>
</http:inbound-endpoint>
<object-to-string-transformer mimeType="text/xml"/>
<jms:outbound-endpoint queue="servicesQueue" connector-ref="Active_MQ"
exchange-pattern="request-response" responseTimeout="1000000" />
</flow>
<flow name="QueueToMyServices">
<jms:inbound-endpoint queue="servicesQueue" connector-ref="Active_MQ"
exchange-pattern="request-response" />
<http:outbound-endpoint exchange-pattern="request-response" host="localhost"
port="5050" path="MyServices" method="POST" contentType="text/xml">
<set-property propertyName="Content-Type" value="text/xml"/>
</http:outbound-endpoint>
</flow>