License for clients Jars , njms , nclient

I have a project for a client that is integrating with a third party using the um broker nirvana.
he provided me with two jars nclients and njms.jar
My question is what is the license that controls those two jars, can I include them inside my “war”

You don’t need a license, license is only required on the server side not for client.
The njms.jar is only required if you want to interface via the JMS standard.

If you want to use the native UM API to communicate then you only need the nclient.jar file.
regards
John.

1 Like

Hello, we have been commissioned with a client to connect to a messaging system (GSIMT) where they comment on the two libraries nClient and nJMS.

Do we need to install the Nivana software?
How do we create this server?
Do you have any example code?
What server do we need to test locally?

Thanks

I assume that you want to be able to send or receive events via Universal Messaging into some third party app. What is this app ? Is it a java based app ? Can you add code to it ?
If so then you would simply add the above nclients.jar file to the class path and then develop a listener to fetch events and map then into your application. Or you could update your application to send events to UM.

It’s hard to be more concrete without more detail of what your use case is.
regards,
John.

1 Like

Banks connect directly to the GSIMT messaging system, in Client / Server mode, with high security via SSL (TLS 1.3) and client authentication, with the JMS Web Methods Client.

The APIs needed to connect to the MOM queues, read or write, are contained in the zip (nclient and nJMS)

They have asked us to create a system of exchange of messages between us and a system of compensation.

We think we need these APIs from nirvana. It’s right?

more details they pass us:

Customers communicate through middleware with the nhps protocol:

nhps - Specifies Nirvana HTTP Protocol Secure (nhps), i.e. using SSL / TLS

The connection string is as follows:

String RNAME = ({“nhps: // remoteHost: 443”});
nSessionAttrib nsa = new nSessionAttrib (RNAME);

We need use nirvana?, or just jms ??
Need any server application??

Hi,

hopefully the GSIMT system will host the UM Nirvana Server (which schould be referred to as “remoteHost” according to your code snippet above.
Therefore the GSIMT should be able to provide you with all neccessary informations to connect to their system.

No need to install anything on your side locally except to put the jar file in the classpath and build path of your application and bundle them with your deployable object.

Regards,
Holger

Thanks.

How can do client?

We have create two java aplication (sender/receiver) and deploy in tomcat local, but not works:

Naming Exception : Please ensure you have created the connection factory jmsqueuesub
Naming Exception : This can be done using the Enterprise Manager JNDI panel or the jmsadmin command line application
javax.naming.CommunicationException: JNDI setup failed on RNAME=nsp://localhost:61616 [Root exception is com.pcbsys.nirvana.client.nSessionNotConnectedException: The session is not currently connected to the server. Unable to perform the request:Session has been closed via another thread]
at com.pcbsys.nirvana.nSpace.NirvanaContext.(NirvanaContext.java:186)

U have any code demo?
In wich server we can mount this java code?

The UM Server installation comes with samples for Java/Python/DotNet etc. You can request this from the server side. The samples for Java are located under %installDir%\softwareAG105\UniversalMessaging\java\examples folder. Below is a snippet of the code that I wrote based on the samples that came with the product. You can refer to the “Enterprise Developer’s Guide for Java” section in the Universal_Messaging_Developer_Guide from SoftwareAG.

private static Session session;
	private static Boolean transacted=true;
	private static MessageProducer producer;
	private static final Object mutex = new Object();
	protected static int publishCount = 0;
	
	public static void main(String[] args) {
		try {
			Hashtable<String,String> env = new Hashtable<String,String>();
		    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.pcbsys.nirvana.nSpace.NirvanaContextFactory");
		    env.put(Context.PROVIDER_URL, "nsp://localhost:9000");
		    Context ctx=new InitialContext(env);
		    
		    ConnectionFactory cf = (ConnectionFactory) ctx.lookup("TestTopicConnFactory");
		    Connection c = cf.createConnection();

		    session = c.createSession(transacted, 1);
		    Destination d = getDestination(ctx, session, "TestTopic");
		    producer = session.createProducer(d);

		    BufferedReader br = new BufferedReader(new InputStreamReader(System.in), 1);
		    System.out.print("Enter a message to be published : ");
		    String str = br.readLine();
		    TextMessage bmsg = session.createTextMessage();
		    bmsg.setText(str);
		    if (transacted) {
		    	doTXPublish(bmsg);
		    } 
		    else{
		    	doPublish(bmsg);
		    }
		    System.out.println("Closing session and connection");
		    Thread.sleep(1000);
		    c.close();
		    session.close();
		    ctx.close();
		} catch (NamingException ex) {
			System.out.println("\nNaming Exception : Please ensure you have created the connection factory TestTopicConnFactory");			
			ex.printStackTrace();
			System.exit(1);
		} catch (Exception ex) {
			System.out.println("Exception: "+ex.toString());
			ex.printStackTrace();
			System.exit(1);
		}
	}
	
	private static Destination getDestination(Context ctx, Session s, String destName) {
	    Destination d = null;
	    try {
	    	d = (Destination) ctx.lookup(destName);
	    } catch (NamingException e) {
	    	try {
	    		if (s instanceof TopicSession) {
	    			d = s.createTopic(destName);
	    		} else {
	    			d = s.createQueue(destName);
	    		}
	    		ctx.bind(destName, d);
	    	} catch (Exception e1) {
	    		e1.printStackTrace();
	    	}
	    }
	    return d;
	  }
	
	private static void doPublish(Message msg) {
		try {
			producer.send(msg);	      
	    } catch (JMSException e) {
	    	e.printStackTrace();
	    	boolean committed = false;
	    	while (!committed) {
	    		try {
	    			producer.send(msg);
	    			committed = true;
	    		} catch (JMSException ex) {
	    			try {
	    				Thread.sleep(1000);
	    			} catch (InterruptedException ignored) {}
	    		}
	    	}
	    }
	  }
	
	private static void doTXPublish(Message msg) {
		boolean success = false;
		while (!success) {
			try {
				producer.send(msg);
				success = true;
			  } catch (Throwable t) {
				  System.out.println("JMS-Producer send failed - "+t);
				  synchronized (mutex) {
					  try {
						  mutex.wait(5);
					  } catch (InterruptedException ignored) {}
				  }
			  }
		  }
		  success = false;
		  while (!success) {
			  try {
				  session.commit();
				  success = true;
				  synchronized (mutex) {
					  mutex.wait(10); //NB: Modify or comment this out, to change the throttling level
				  }
			  } catch (Throwable t) {
				  System.out.println("JMS-Producer commit failed - "+t);
				  try {
					  synchronized (mutex) {
						  mutex.wait(500);
					  }
				  } catch (InterruptedException ignored) {}
			  }
		  }
	  }
}
1 Like

thanks,

this code can run in a tomcat or websphere ? Not necessaru 2 javas ?? one sender another receiver?

We do not have the server code, we have to create the client.
Can’t we create locally?

We use eclipse, any manual?
which server to use ?? tomcat? websphere? …

Hello,

We do not yet have the URL of our client’s server.
In order to test and generate the sending and receiving classes, we must install nirvana locally?
Is there a step by step? to test locally? any demo, project or example code?

Unfortunately what you are asking is not something that i can explain in a single post…it sounds too broad in nature for me. I would recommend you start reading the documentation(Java section) that i referred to. That will give you a high level of understanding of what you need to do for implementing this and then it will direct you to the places from where samples can be retrieved from.

Thanks, i download trial webmethod and installed in my pc.
Now i need start server??