Announcement Announcement Module
Collapse
No announcement yet.
dynamic inbound amqp adapter queue names Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • dynamic inbound amqp adapter queue names

    we have a use case where we need to have the queue-that the inbound amqp adapter receives from is:

    1. named the same as the hostname of the server it is running on. we read the hostname in the pojo that launches the spring context. the hostname is set to a system property like this:

    Code:
    System.setProperty("hostname", localhostname);
    How do we access this or property or otherwise set the queue-name attribute of the inbound amqp adapter ?
    I noticed that the inbound amqp adapter can't seem to have a nested property associated with it like this:

    Code:
    <int-amqp:inbound-channel-adapter id="hostQueue" channel="hostQueue" queue-names="${hostname}" connection-factory="connectionFactory">
    	<property name="hostname" value="#{ systemProperties['hostname']}"/>
    </int-amqp:inbound-channel-adapter>

    2. created (declared ) in Rabbit if it doesn't already exist.

    I am looking at PollableAmqpChannel but I am not sure how to use it config
    Last edited by ehrdoctors; Jun 1st, 2013, 11:49 AM.

  • #2
    1. Why not simply use
    Code:
    queue-names="#{systemProperties['hostname']}"
    ??

    2. Just add <rabbit:queue/> and <rabbit:admin/> entries to the config...

    Code:
    <rabbit:admin connection-factory="connectionFactory" />
    
    <rabbit:queue id="hostSpecificQueue" name="#{systemProperties['hostName']}" />

    Comment

    Working...
    X