How to get client connection to an specific channel in UM?

What product/components do you use and which version/fix level?

UM 10.5

Are you using a free trial or a product with a customer license?

Customer License

What are trying to achieve? Please describe in detail.

I have a java client connect to my um local realm (127.0.0.1:9000), inside it I have a channel named pgreplicationd(is a topic).
When I connect my client to local realm server the connection appears in Realm > Monitoring > Connections

But that connection does not appears in my Topic > Connections view. Why?

My Java Client send information using pgreplicationd topic succesfully. In IS I have a JMS trigger that get this information an then execute a flow service to log the message.

Regards,
Jesus

Hi @Jesus_Carrillo1.

Do you have any subscribers added to specific topic? If yes, They should be visible from the Topic-> Connections view.
Please check the doc link: Viewing Channel Connections (softwareag.com)

Hope this helps.

Regards,
Anil

Im sorry but how can I add a subscriber to my topic? Client sent information to my topic sucessfully right now, but “suscription” is about the client who send information or the IS flow service who receive it?

Hi @Jesus_Carrillo1,

The client who send information to the topic will be publishing the data i.e. Publisher and the one who receive it by subscribing to the topic will be the subscriber for the topic. So, In this case as you mentioned the IS flow service who is receiving it will be the subscriber.

Regards,
Anil

Hi, @Anil_Kumar_Pamisetty
Ok, Topic > Connections view is for suscriptors.
Realm > Connections view is for publishers.
So, is there a way to know only publishers of a specific topic?

Right now I use API Admin java for retrieve all connetions (Java Service in IS):

> String[] RNAME={"nsp://127.0.0.1:9000"};
> String traza = "";
> nSessionAttributes nsa;
> nsa = new nSessionAttributes(RNAME);
> nRealmNode realm = new nRealmNode(nsa);
> Thread.sleep(realm.getUpdateInterval());
> nNode topic = realm.findNode("pgreplicationd");
> MonitorListener ml = _instance.new MonitorListener(); //_instance is a obj from flow service. MonitorListener is a internal class
> realm.addConnectionListener(ml); //I've add a connection listener to realm to get all connections (Realm > Connection view in Enterprise Manager)

//This is my internal class
class MonitorListener implements nConnectionListener{
		
		@Override
		public void add(nConnectionDetails cd) {
			// TODO Auto-generated method stub
			for(String e : cd.getSubject()) {
				JournalLogger.log(4,90,4,"Log","new Connection: "+e);
			}
		}
	
		@Override
		public void del(nConnectionDetails cd) {
			// TODO Auto-generated method stub
			for(String e : cd.getSubject()) {
				JournalLogger.log(4,90,4,"Log:","Desconection: "+e);
			}
		}
		
	}

This code retrieve all connections from realm but how could I know which of them are connections to my topic?
Ive tried add listener to my topic but not work.

nLeafNode pgreplication = (nLeafNode) topic;
pgreplication.addListener(ml);

And, is there a way for retrieve thats connections without listener? My idea is execute the java service when I need to know the publisher connections to my topic and save that data to database. I understand that listener are done for continuous executions, like a permanently running program but this is the given way from Software AG Documentation.

So, how can I get a nConnectionDetails object from realm o topic without listener?

Should I open a new post with this?

Thank you so much.

Hi @Jesus_Carrillo1 ,

The listener for topic is working for me. It is executing the add method of the listener.
I have tried this

nTopicNode topicNode = (nTopicNode) realmNode.findNode("channel1");
topicNode.addListener(this);

and also it works fine as below:

nLeafNode topicNode = (nLeadNode) realmNode.findNode("channel1");
topicNode.addListener(this);

I am not very sure about the fetching connection details without listeners through Admin API.

Regards,
Anil

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.