How to notify (or send a message) a swing client from an application server (EJB)?

I have a project that has clients (swing), and you will have an EJB application running on the server.

My question is about communication. I want to use MDB (message-driven beans) when a client sends a message to the server. But I noticed that the application server sends a message (or any data) to notify the client.

For example, client1 has the form (text field and button), and client2 has a list (lists the data that client1 sends to the server). When client1 sends data (message, etc.) to the server, perform some task on it than send (notify) the data to client2.

How can i do this? Any help would be greatly appreciated. Thank.

+4
source share
1 answer

Are there any ways to achieve what you ask.

I personally prefer:

client1 has an SB (Bean session) that connects to the JMS queue (the JMS queue is configured on the server), for now we will call it inQueue.

after the form data is in inQueue, you will need MDB (a message-driven bean running on a server that will retrieve data from inQueue, we will call it MDBInQueue.

The server in MDBInQueue processes the data received in the form and generates the appropriate output format for the client.

Now again in MDBInQueue it sends a response to the next queue, which is again on the server. we will call it outQueue.

2 MDB, MDBOutQueue. , , 2.

,

+1

Source: https://habr.com/ru/post/1531549/


All Articles