Multi-tenancy with spring-amqp using Nio

223 views
Skip to first unread message

Andreas Heinen

unread,
Jun 18, 2019, 5:30:13 AM6/18/19
to rabbitmq-users
Hello,

I'm trying to create a multi-tenancy (tenants are customers not applications) separated by vhosts.

For this I use spring-rabbit and the org.springframework.amqp.rabbit.connection.AbstractRoutingConnectionFactory. 

Is there a way to enable "java non-blocking IO" with Spring? If not, is it possible to combine the AbstractRoutingConnectionFactory with the ConnectionFactory provided by com.rabbitmq or do I have to switch to the com.rabbitmq.client.ConnectionFactory and the fitting routing-connection-factory which is supporting useNio().

Regards,
Andreas


Gary Russell

unread,
Jun 18, 2019, 9:18:19 AM6/18/19
to rabbitm...@googlegroups.com
Please ask questions about Spring on Stack Overflow; the Spring team doesn't monitor this group as often.

Spring's CachingConnectionFactory uses the amqp-client ConnectionFactory. See "Configuring the Underlying Client Connection Factory" [1].

You can use Spring's RabbitConnectionFactoryBean to create the amqp-client connection factory (call setUseNio(true)) .

You can then pass it into the CachingConnectionFactory via a constructor. Or you can use 

cachingConnectionFactory.getRabbitConnectionFactory().useNio();

to reconfigure the underlying factory before opening a connection.


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/6619094a-e113-4a8c-8e31-5ebf25202ed6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages