Event Framework
R24 AMR | Min(s) read

Executing an Inflow Request

You can execute an Inflow request using ESB, JMS queues and REST API. The ESB solution is supported by IIB Adapter.

Executing an Inflow Request with ESB

You can execute an Inflow request using the T24 (Temenos Transact) Custom Outbound Adapter for IIB. This topic shows how to configure T24 Custom Outbound Adapter for IIB with Inflow.

For more details on T24 Custom Outbound Adpater for IIB see the user guide for T24 Custom Outbound Adpater for IIB.

Follow the steps below to execute an inflow request with ESB.

  1. While performing metadata discovery, select the outbound adapter. The Configure Settings for Discovery Agent wizard opens.
  2. Select Inflow as the outbound type, configure web service connection parameters to use the ESB solution for Inflow and click Next.

    The list of inflows available in Transact is displayed.

  3. From the list, select the inflow to which you would like the request to be sent.

  4. Perform the rest of the steps in the metadata discovery. They are the same as those for service XML metadata discovery.

    When you configure the message flow, make sure that the inflow is selected as Request Type to configure the Transact custom outbound adapter with the inflow type.

    HttpHost and HttpPort are mandatory for inflow

    The rest of the steps remain the same as in the case of Transact customer outbound adapter for IIB . For more information, see the IIB user guide.

Executing an Inflow request using a non-ESB solution

You have to post the message to the inflow queue (inflow) using any tool that can post a message to this queue or you can write a simple Java program as the one below. These programs have a few dependencies: org.apache.commons.io.jar and javaee-api-7.0.jar are common dependencies for all the supported application servers.

JBoss

This sample for JBoss requires jboss-client.jar. This jar file is available in jBoss\bin\client.

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Date;
import java.util.Properties;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.apache.commons.io.FileUtils;
import java.util.logging.Logger;
import javax.jms.BytesMessage;
import javax.jms.Connection;

public class MessageProducerJBOSS {
	private static final Logger LOGGER = Logger.getLogger(MessageProducerJBOSS.class.getName());
	public static void main(String [] args) throws Exception{
		new MessageProducerJBOSS().putMessage();
	}
    public void putMessage() throws Exception{
    	Context namingContext = null;
    	final Properties prop = new Properties();
    	prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
    	prop.put(Context.PROVIDER_URL,"http-remoting://localhost:9089");
        namingContext = new InitialContext(prop);
        
        ConnectionFactory connectionFactory = (ConnectionFactory) 
        		namingContext.lookup ("jms/RemoteConnectionFactory");
        Destination queue = (Destination) namingContext.lookup ("inflow");
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession();
        BufferedReader br;
        StringBuilder sb = new StringBuilder();
        FileUtils utils=new FileUtils();
        @SuppressWarnings("static-access")
        String newinput = utils.readFileToString(new File("C:\\Inflow\\testing\\newInput\\inflowrequest\\IFW-ContainerCUSTONBMAP.xml"));
        javax.jms.MessageProducer producer = session.createProducer(queue);
        TextMessage txtMsg = 
        		   session.createTextMessage (newinput);
        
        ((javax.jms.MessageProducer) producer).send (txtMsg);
        System.out.println("Hi");
        connection.close();
    }
}

WebSphere Application Server

This program requires the following dependent jars:

  • com.ibm.ws.ejb.thinclient_9.0.jar
  • com.ibm.ws.orb_9.0.jar
  • com.ibm.ws.sib.client.thin.jms_9.0.jar
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import javax.jms.Connection;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.commons.io.FileUtils;
import com.ibm.websphere.sib.api.jms.JmsConnectionFactory;
import com.ibm.websphere.sib.api.jms.JmsFactoryFactory;
import com.ibm.websphere.sib.api.jms.JmsQueue;
import com.ibm.websphere.sib.api.jms.JmsTopic;

public class JMSMessageInjector {
	public static void main(String[] args) throws JMSException, IOException {

		String destUrl = "queue://inflow";
		String busName = "T24BUS";
		String providerEndpoints = "localhost:7276";
		Destination dest;
		JmsFactoryFactory jmsFact = JmsFactoryFactory.getInstance();
		JmsQueue queue = jmsFact.createQueue(destUrl);
		dest = queue;
		JmsConnectionFactory connFact = jmsFact.createConnectionFactory();
		connFact.setBusName(busName);
		connFact.setProviderEndpoints(providerEndpoints);
		Connection conn = connFact.createConnection();
		Session session = null;
		MessageProducer producer = null;
		session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
		producer =  session.createProducer(dest);
		System.out.println("Ready to send to " + dest + " on bus " + busName);
		FileUtils utils=new FileUtils();
		@SuppressWarnings("static-access")
	    String newinput = utils.readFileToString(new File("C:\\Inflow\\testing\\newInput\\inflowrequest\\in - Copy.txt"));
		TextMessage message = session.createTextMessage(newinput);
		 ((javax.jms.MessageProducer) producer).send(message,
                 Message.DEFAULT_DELIVERY_MODE,
                 Message.DEFAULT_PRIORITY,
                 Message.DEFAULT_TIME_TO_LIVE);
	}
}

WebLogic

This sample program for WebLogic requires wlclient.jar.

import java.io.BufferedReader;
import java.io.File;
import java.util.Hashtable;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.apache.commons.io.FileUtils;

public class WeblogicJMSInjector {

	public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
	 public final static String JMS_FACTORY="jms/ConnectionFactoryLocal";
	 public final static String QUEUE="jms/t24IFInboundQueue";
	 public final static String url = "t3://localhost:7001";
	 public static void main (String [] args){
		try{
		Hashtable env = new Hashtable();
	    env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
	    env.put(Context.PROVIDER_URL, url);
	    Context namingContext = null;
	    namingContext = new InitialContext(env);
        
        ConnectionFactory connectionFactory = (ConnectionFactory) 
        		namingContext.lookup (JMS_FACTORY);
        Destination queue = (Destination) namingContext.lookup (QUEUE);
        Connection connection = connectionFactory.createConnection();
        Session session = connection.createSession();
        BufferedReader br;
        StringBuilder sb = new StringBuilder();
        FileUtils utils=new FileUtils();
        @SuppressWarnings("static-access")
        String newinput = utils.readFileToString(new File("C:\\Inflow\\testing\\newInput\\inflowrequest\\in - Copy.txt"));
        javax.jms.MessageProducer producer = session.createProducer(queue);
        TextMessage txtMsg = 
        		   session.createTextMessage (newinput);
        
        ((javax.jms.MessageProducer) producer).send (txtMsg);
        System.out.println("Hi");
        connection.close();
	}catch(Exception e){
		e.printStackTrace();
		}
	}
}

Posting RESTful HTTP API Messages to Inflow

This feature enables you to post Inflow request using a RESTful HTTP API.

Run the URL below in the API development platform.

http://<host:port>/inflow/api/v1/process

For example, you can send an Inflow request as shown below.

Copyright © 2020- Temenos Headquarters SA

Published on :
Monday, May 27, 2024 4:29:31 PM IST