I have an application A, which is spring boot, microservices based and is dockerized.
A has an inbuilt messaging framework and supports multiple implementations such as RabbitMQ, Kafka and ActiveMQ.
The default broker for the application is RabbitMQ. RabbitMQ runs in a separate container.
Now B is a java console spring boot application.
B needs to listen to a topic on RabbitMQ to receive messages from application A
I am able to implement this in a stand-alone way. That is, I use RabbitMQ specific interfaces, create connection factory and am able to receive messages in B from A.
My question is:
Will I be able to use A's messaging framework in B to listen to messages? I have tried adding a subscriber. I'm able to connect to RabbitMQ but not able to receive messages. RabbitMQ host that I'm using is "localhost"
Related
I want to create a server for IoT (ODB GPS trackers for cars) that will send its status to server in real time and show it to client via a web applications.
The devices will connect to server using TCP, and then there will be client/web connecting to server via Websocket.
Spring Webflux is used for the client side. But I do not find a tutorial of Spring Boot TCP Server. And I read that netty is good for that (found an example using netty). So, because webflux is using netty underneath, can I use netty application code with spring boot?? Or is there a way using spring boot for tcp socket programming??
Currently I'm working on a Java web application which runs on Resin 4.0.55 and I am new to working with AWS SQS.
I need to implement a SQS message listener (JMS message listener as consumer) for my resin application. The listener should listen to the SQS FIFO queue and once a message appear on the queue, the web application should receive the message.
Currently I'm referring following AWS documentations:
Getting Started with the Amazon SQS Java Messaging Library
Working Java Example for Using JMS with Amazon SQS Standard Queues
Please kindly help me to implement a listener for Java application in Resin server.
I am having two java web applications deployed on different app-servers. I want to exchange messages between the two using JMS. I know how to do it for applications running under same app-server, but I cannot find any example for the applications distributed over different app-servers.
I am using Glassfish 4.1 as application server.
You can create queues with same names on both servers, and let the first queue push its messages to the second one using glassfish configuration, so let the imq brokers do the job. Configure the jms connection factory on the first server with the property "AddressList" with value "mq://host2:port2" with the settings for the second broker.
See the glassfish resource template for such a configuration in the OSCM Service Catalog https://github.com/servicecatalog/development/blob/master/oscm-installation/domains/bes_domain/installer/resources-template.xml
The example is the connection factory "jms/bss/masterIndexerQueueFactory" which you can find in this template.
More about the Open Source Project OSCM Cloud Service Management Software
I have a few tomcat servlet-containers and I need to deploy activemq within one of them to allows the other containers connect to that broker. All the tomcats runnning on the same machine.
I need to avoid deploying a standlone message broker now, beucase it's not allowed by out producion evironment.
To be more specifiec, I'm using spring framework and as far as I understood we can write the following in order to start the embedded broker:
BrokerService broker = new BrokerService();
// configure the broker
broker.addConnector("tcp://localhost:61616");
broker.start();
But does it allow to connect to the broker not only within the same application, but also from the other tomcat instances using the 61616 port?
Yes that allows remote connection on port 61616.
At Apache Camel we have also an example of embedding ActiveMQ broker in a WAR application, and using the xml configuration of ActiveMQ. You can find it here: http://camel.apache.org/activemq-camel-tomcat.html
I want to subscribe to the JMS queue with no usage of EJB MDB. The reason is that I want to receive messages only when I want, but not automatically.
Is there some ways to implement it using plain Java (no Spring or smth else)?
I use WebLogic and its internal JMS provider, if it is important.
Thanks.
Yes, you should be able to connect to your JMS Queue of your Application server. JMS is a quite good standard, so after getting your Connection/Queue, the implementation is Vendor agnostic.
Here is a short overview what you have to write to create a consumer/producer with JMS: JMS Sample
This shows each step in detail with WebLogic JMS: Developing a WebLogic JMS Application
I didn't used WebLogic or it's JMS implementation, maybe you have to configure Weblogics JMS: Configuring and Managing WebLogic JMS
For a comprehensive overview of the programming capabilities of your WebLogic JMS Provider, look here: Programming WebLogic JMS