Spring JMS - How to define Connection Proxy - spring

I want to define a proxy for a connection to Azure Service bus using aqmp.
I'm in a Springboot app, v1.5, and I'm using Apache qpid-jms-client.
Actually, I'm declaring a JmsTemplate bean that receive a CachingConnectionFactory.
How to define a proxy with CachingConnectionFactory (Or any other connectionFactory implementation) ?
Thanks

There was an update on the jar which now allows proxies .
Check this out :
How to create connection to AMQP queue over SSL using SOCKS proxy or any other proxy in java

Related

Configure connection for a direct exchange in Spring Boot AMQP

I'm developing a service that sends messages to a RabbitMQ instance but the connectino has to be done through a proxy.
Is there a way to configure the connection so I can set up the host and port of the proxy as you can do when using RestTemplate but for RabbitTemplate?
Any help would be really appreciated,
Regards

Spring Stomp websockets with activemq client

I am trying to build a stomp websocket and use amazon activemq service.
it provides 2 url (one in case of failure) and I was wondering if I could use the ActiveMQConnectionFactory to setup the message broker.
so, basically inside DelegatingWebSocketMessageBrokerConfiguration use ActiveMQConnectionFactory to set the client on the stompBroker, instead of or along the ReactorNettyTcpClient.
Basicaly I want to take advantage of the failure recovery url in aws mq.

JMS provider URL for jboss in-vm destination

Running app on EPA 7 with log4j2. We have an appender that writes to a JMS queue.
I got it working for remote connection as below:
<JMS name="HIFAuditAppender"
destinationBindingName="jms/queue/HIFAuditQueue"
factoryBindingName="jms/RemoteConnectionFactory"
providerURL="http-remoting://127.0.0.1:8080"
username="hcmuser"
password="gators123="
factoryName="org.jboss.naming.remote.client.InitialContextFactory" />
However, the JMS producer and MDB are running in the same JVM. I want to use the jboss in-vm connector, but have not been able to determine what the providerURL should be set to.
The providerURL will be same i.e http-remoting://127.0.0.1:8080. You need to use in-vm connection factory i.e /ConnectionFactory which uses in-vm connector and used to produce/consume messages locally.

not able to send message to remote Tomcat and ActiveMQ queue

I have a set of JMS queues configured on a Tomcat + ActiveMQ server. I have created a Resource for connectionFactory (by pointing the Broker to tcp:localhost:61616) and a resource for Queue in Server.xml inside global resource and then declared these 2 resource as in context.xml.
Now I'm trying to connect this queue from another tomcat server and send message. When trying to get lookup for connection factory with jndi name I am getting NamingException - name not bound in this context for the ConnectionFactory JNDI.
I tried to achieve like this:
set below values in properties
Provider_URL = http://Localhost:8080
INITIAL_CONTEXT_FACTORY = org.apache.naming.java.javaURLContextFactory
and then create new InitialContext with above property value and then lookup for the jndi of connectionFactory.
But its not working.
I tried other option to directly get context of the ActiveMQ by using ActiveMQContextFactory as INITIAL_CONTEXT_FACTORY and Provider_URL= tcp://localhost:61616
and I kept a simple jndi.properties file in the classpath of client tomcat server as it is mentioned in other posts. And It works well.
But I do not like it. Because when I configured the activeMQ connection and Queue as a resource in Tomcat, that means I should be able to get JNDI lookup through Tomcat and not directly to Active mq. I do not want to give ActiveMQ host:port to all my clients.
I assume there must be something incorrect on Tomcat server configuration that its connectionfactory/queue JNDI is not available for lookup outside.
I have struggle a lot today. Can someone expert point me to some possible mistake.
Thanks in advance.

Spring's DefaultMessageListenerContainer to use connection factory directly from broker or JCA managed?

I have a Spring Integration application, where I have a JMS inbound channel adapter that will receive messages from a queue in a remote JMS broker. I'm looking up the connection factory directly from the broker's remote JNDI service and this is what I use to set up my inbound channel adapter. I understand that behind the scenes there is a DefaultMessageListenerContainer. According to AbstractMessageListenerContainer javadocs, found here, if "sessionTransacted" is set to "true" for the DMLC, local JMS transactions will be used for the delivery of messages from the broker.
I'm not interested in having the receipt of messages to be part of externally managed transactions.
Now, if the JMS broker provides a resource adapter and therefore there is a JCA managed connection factory (that might be capable of participating in JTA transactions) configured in a JBoss App server where my Spring Integration is running packaged in a war . I could use this instead of directly looking up from the broker's JNDI as I described above. Since I am not interested in global transactions, I don't see the value of using this JCA connection factory, moreover I don't know if the caching of connections/sessions that JCA does might clash with the DMLC caching strategy. Additionally I'm not sure if adding a JCA layer to wrap the original connection factory will impact performance.
Which is the right approach then, take connection factory directly from broker JNDI and let DMLC handle everything or take a JCA managed connection? There seems to be a not very well documented school of thought that tells that JCA is safer and more robust, but if I'm not using EJBs I dont see how this can be true.

Resources