How to identify connections? - activemq-artemis

One of the Artemis web console views shows connections. I would like to identify connections. I would like to easily recognize which connection is from which application. I know that I can set Client ID but as I understand I have to use JMS API. Client ID can be set by calling org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory#setClientID method. ActiveMQConnectionFactory class is placed in org.apache.activemq:artemis-jms-client maven artifact.
Unfortunately I do not use JMS API and I do not want to use it. I use the Artemis core API (ServerLocator, ClientSessionFactory, ClientSession etc from the org.apache.activemq.artemis.api.core.client package). How to identity connections?

I found a way how to set Client ID. It can be set on org.apache.activemq.artemis.api.core.client.ClientSession instance:
public static String JMS_SESSION_CLIENT_ID_PROPERTY = "jms-client-id";
...
session.addMetaData(ClientSession.JMS_SESSION_IDENTIFIER_PROPERTY, "");
session.addMetaData(JMS_SESSION_CLIENT_ID_PROPERTY, "myClientID");

Related

Spring Boot detect lost connection to GemFire

Does Spring Data GemFire provide any way to detect lost connection to GemFire Locator or Server from client-side application? I want to trigger an event to send an alert to inform user and then send request to other application to resend the information when connection is up.
Spring Data for VMware GemFire (SDG) does not in/directly (depending on your perspective) provide an API or means to detect when a client is disconnected from a cluster since GemFire/Geode already provides such mecahanisms.
See the ClientMembershipListener interface (Javadoc).
Use the ClientMembership (Javadoc) class to register an implementation instance of the interface.

SalesForce's URL for Kafka provider

I'm trying to determine the URL for SalesForce as it relates to setting up a Kafka Provider. I'm using Bayeux client that needs a URL to SalesForce for connection:
new KafkaOptions(new Uri(""));
Thanks.
It seems you are using this Kafka library, which has nothing to do with Salesforce, but you give it a string of your Kafka broker addresses, as shown in the examples there.
Note: That library doesn't look actively maintained and Kafka is not an http protocol so putting http://server:9092 doesn't make sense...
You might want to checkout confluent-kafka-dotnet instead.

use of io.Manager class in socket.io

Socket.io has provided docs about io.Manager class. It also tells about how to make a manager object. But it does not use this manager object anywhere in any example.
I want to ask whether this Manager class has any practical use or not. Since I am new to Socket.io, it would be helpful if someone tell the use of manager object with an example in layman way. If there is no direct use of manager object in making an application, then confirm it also.
See these docs: https://socket.io/docs/v4/client-api/#manager
The Manager manages the Engine.IO client instance, which is the low-level engine that establishes the connection to the server (by using transports like WebSocket or HTTP long-polling). The Manager handles the reconnection logic. A single Manager can be used by several Sockets.
Please note that, in most cases, you won't use the Manager directly but use the Socket instance instead.

How to process the webservice xml message in mirth

How to process the webservice XML message in Mirth Connect 3.x?
If I understand your question correct, you are asking for how to configure Mirth to become a Web server. It's actually easy and hard at the same time.
The easy way - create a new channel and configure the Source connector as Web Service Listener. Deploy the channel and you have a web server waiting for SOAP messages to be sent to a configured IP port. But the structure of these SOAP messages is governed by Mirth WSDL at localhost:8081/services/Mirth?wsdl.
If you want the SOAP message structure to be different then you are going to deep dive into creating your own Java class and overriding default web service methods. There is no a single answer for that, it is a completely separate topic.
I hope you are asking how to consume XML webservice message in Mirth?..
If you are receiving specifically SOAP you need to set webservice listener as your source channel listener. (as said previous answer, you will have the URL)
Go to your transformer and type the following code:
logger.info(connectorMessage.getRawData());
Once you do this you can see the data you received inside Mirth on the logger area.

gwt connection between clients

I’m very new to gwt developing and I would like to know, if it is possible to change client information’s from another client. I would like to do following;
Person A adds a new car to a list, this modification should also add automatically to another client (website). Is that possible with gwt? Right now, I’m just having the idea to use a solution with a SQL database. Is there a way to connect two websites?
Greet
There is no way to do that directly from client to client.
You will have to implement it via a backend (not necessarily a SQL Server).
Client A sends the modifications/data to the backend.
In order for Client B to see the update you can rely on two different techniques:
Pull by polling via a Timer (easy to implement)
Push either by Websockets or Comet (check out atmosphere project)
Push via event based service (check out gwteventservice project)