Closed spring-operator closed 12 years ago
Gary Russell commented
Hmmm... works ok for me on a modified version of the amqp sample...
<!-- From STDIN To RabbitMQ -->
<int-stream:stdin-channel-adapter id="consoleIn" channel="toHE" >
<int:poller fixed-delay="1000" max-messages-per-poll="1" />
</int-stream:stdin-channel-adapter>
<int:channel id="toRabbit" />
<int:header-enricher input-channel="toHE" output-channel="toRabbit">
<int:header name="xyz" value="abc"/>
<int:header name="def" value="ghi"/>
</int:header-enricher>
<int-amqp:outbound-channel-adapter channel="toRabbit"
amqp-template="amqpTemplate" exchange-name="si.test.exchange"
routing-key="si.test.binding"
mapped-request-headers="xyz, def"/>
<!-- From RabbitMQ To STDOUT -->
<int-amqp:inbound-channel-adapter channel="fromRabbit"
queue-names="si.test.queue"
mapped-request-headers="xyz, def"
connection-factory="connectionFactory" />
<int:channel id="fromRabbit">
<int:interceptors>
<int:wire-tap channel="loggingChannel"/>
</int:interceptors>
</int:channel>
Received message: (Body:'zzz'; ID:null; Content:text/plain; Headers:{def=ghi, xyz=abc}; Exchange:si.test.exchange; RoutingKey:si.test.binding; Reply:null; DeliveryMode:PERSISTENT; DeliveryTag:1)
headerName=[def] WILL be mapped, matched pattern=def
headerName=[xyz] WILL be mapped, matched pattern=xyz
preSend on channel 'fromRabbit', message: [Payload=zzz][Headers={timestamp=1323213036622, id=1e532949-99b5-4b87-b344-14fb0bece737, def=ghi, xyz=abc}]
Josh, can you attach a debug log?
Mark Fisher commented
Josh, it's not clear to me from reading the comment above, are you saying that it DOES work when you provide "*"?
Josh Long commented
No, in my particular example it didn't seem to work, but clearly I've misconfigured ...something.. if the above works as expected. Please ignore, and I'm sorry for the trouble.
Mark Fisher commented
Okay. If you run into any situation in the future, please re-open this issue. I'll resolve it for now.
Josh Long opened INT-2296 and commented
The gist of it is :
I'm sending a message to Rabbit using the Spring AMQP outbound adapter and I expect the headers that are in the message to be in the message when the message pops out the other end and is consumed by the AMQP inbound channel adapter.
The code for the gateway is:
So the messages are sent with headers (MailHeaders.TO, and MailHeaders.SUBJECT) that should be there in the message on the broker.
Then, on the other end≤ I have:
Then I had a service activator and i stuck a break point there and it didn't have the headers (MailHeaders.TO, and MailHeaders.SUBJECT) anywhere to be found.
I tried various incantations of the mapped-request-headers, finally deciding to just use * to let everything through, but clearly it's not working...
Affects: 2.1 RC1