Announcement Announcement Module
No announcement yet.
Virtual host problem Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Virtual host problem

    I'm trying to use the new Spring amqp features to connect to a rabbitMQ-server. My problem is that the queue that I want to connect to is located under a different virtual host on the MQ-server instead of the default one. I can't find where I can set that up. I hoped there would be a setter-method or something for that somewhere, like setVirtualMachine(vm).

    I assume I have to set that up, otherwise it should be impossible to know which queue I' trying to get data from if there were 2 different queues with the same name under 2 different virtual hosts.

    Any input would be appreciated.

  • #2
    Note that the connection factory (currently SingleConnectionFactory) has a constructor which accepts com.rabbitmq.client.ConnectionFactory, which has a setter for the vhost.

    So you could initialize a com.rabbitmq.client.ConnectionFactory, setting its vhost (as well as the host, user and pass) to anything you want, and pass that to Spring AMQP's ConnectionFactory.

    I've not tried that, but I imagine it would work.


    • #3
      I've opened this issue for M2:

      Please vote for it.

      For now, the workaround described above sounds good (set the fully configured target ConnectionFactory instance which can be defined as its own 'bean').


      • #4
        The issue has been resolved on the trunk and will be included in the M2 release.


        • #5
          That sounds great.