330 likes | 471 Views
E163 Adapters for Application Servers. Javier Cuerva Technical Architect eBusiness Division cuerva@sybase.com. Agenda. Describe the fundamental architecture of Adapters for Application Servers (AAS) Process Mode Deliver Mode Acquire Mode / Message Router
E N D
E163 Adapters for Application Servers • Javier Cuerva • Technical Architect • eBusiness Division • cuerva@sybase.com
Agenda • Describe the fundamental architecture of Adapters for Application Servers (AAS) • Process Mode • Deliver Mode • Acquire Mode / Message Router • Use basic troubleshooting related to deployment and execution
Product Overview • AAS is a J2EE framework to bridge : • Application Servers with ERPs and CRMs via Sybase Adapters • Application Servers with Custom Applications accessed via an eADK based Adapter • Built on J2EE 1.3 Spec • JMS, JNDI, EJB, MDB, XML • Certified against EAS 4.1.x, BEA 6.1, WebSphere 4.0.1 • This is not JCA !
Product Overview, cont • How can I get AAS ? • Purchasing the AAS-DK Software • A bundle with AAS and eADK • Purchasing one of the following adapters • Sybase Adapter for SAP/R3 • Sybase Adapter for PeopleSoft • Sybase Adapter for Siebel
Product Overview, cont • What do I get with AAS ? • AAS framework and samples • JMS Open Transport Driver • Message Bridge for Java • Documentation
AAS Architecture EJB User Application (AAS Framework + additional business logic) JMS Adapter EIS JSP Client Servlet Notif. Comp. App Server EAS / BEA / WAS DB
AAS Framework • The framework is composed of EJBs, MDB and a set of supporting java classes. • ProcessMode EJB • Provides a request-reply paradigm • DeliverMode EJB • Provides a one way paradigm • MessageRouter • MessageRouterMDB for J2EE 1.3 Compliant AppServer ( EAS and BEA ) • MessageRouterEJB for IBM WebSphere* • Captures messages initiated by the CRM/ERP
ProcessMode EJB, Overview • The process mode allows an App. Server to send a request to a CRM/ERP and get a correlated reply. • It is a Stateless Session EJB that hides message queue API, such as connecting, sending a message to the adapter’s input queue and wait for the reply or the failure. • A ProcessMode EJB needs to be configured for each running adapter instance. • The Process Mode has • An input Queue, to put the request • An output Queue, to get the reply • A failure Queue
ProcessMode, Overview cont (1) (2) Input Queue PROCESS MODE EJB ERP/CRM ADAPTER (3) (5) (4) Output Queue (4) (5) Fail Queue
ProcessMode EJB deployment • Developers need to create an EJB Jar file to deploy the ProcessMode EJB to the App. Server. • ProcessMode EJB classes are • Home Interface • com.sybase.aas.ejb.ProcessModeHome • Remote Interface • com.sybase.aas.ejb.ProcessMode • Implementation • com.sybase.aas.ejb.ProcessModeImpl
ProcessMode EJB deployment, cont • ProcessMode Resources Environment References • ProcessMode Resources References
ProcessMode EJB deployment, cont • ProcessMode Environment • OPT_APP_GRP and OPT_MSG_TYPE are configured in the adapter configuration file.
ProcessMode API • ProcessMode exposes 6 methods • byte[] process (byte[] request) • byte[] process (byte[] request, long timeout) • byte[] process (byte[] request, long timeout, String optAppGrp, String optMsgType) • byte[] process(byte[] request, String optAppGrp, String optMsgType) • byte[] getReply(CorrelationID correlationID) • byte[] getReply(CorrelationID correlationID, long timeout)
ProcessMode API, cont • All the methods can throw • com.sybase.aas.TimeoutException • com.sybase.aas.FailException • The byte[] contains the XML stream to send to the adapter, the request • The ProcessMode reads both the output Q and Fail Q until the Timeout is expired • If everything is Ok, the reply is put in the output Q
ProcessMode API, cont • If a message is found in the Fail Q, a FailException is thrown • FailException.getFailMessage() retrieves the failure message • If the timeout is expired, a TimeoutException is thrown • TimeoutException.getCorrelatorID () retrieves the CorrelationId • The CorrelationId can be passed to getReply() to retrieve the message again
DeliverMode EJB Overview • Deliver mode is used by applications to supply data to the EIS application when no direct, synchronous reply is required. Due to the transport nature, it is also a mean to send data to an EIS in a batch way without having the app server waiting for the answer. • It is a Stateless Session EJB that hides message queue API, such as connecting and sending a message to the adapter’s input queue • A DeliverMode EJB needs to be configured for each running adapter instance. • The DeliverMode has • An input Queue, to put the request • DeliverMode can be combined with MessageRouter to handle failures
DeliverMode Overview, cont (1) (2) Input Queue DELIVER MODE EJB ERP/CRM ADAPTER (3) (4) MESSAGE ROUTER EJB/MDB (5) Fail Queue
DeliverMode EJB deployment • Developers need to create an EJB Jar file to deploy the DeliverMode EJB to the App. Server. • DeliverMode EJB classes are • Home Interface • com.sybase.aas.ejb.DeliverModeHome • Remote Interface • com.sybase.aas.ejb.DeliverMode • Implementation • com.sybase.aas.ejb.DeliverModeImpl
DeliverMode EJB deployment, cont • DeliverMode Resources Environment References • DeliverMode Resources References
DeliverMode EJB deployment, cont • DeliverMode Environment
DeliverMode API • DeliverMode exposes 4 methods • CorrelationID deliver(byte[] message) • CorrelationID deliver(byte[] message, String optAppGrp, String optMsgType) • void redeliver(byte[] message, CorrelationID correlationID) • void redeliver(byte[] message, String optAppGrp, String optMsgType, CorrelationID correlationID)
DeliverMode API, cont • The message, is the XML stream for the adapter • After writing the message in the Q, the method returns immediately • The CorrelationID is to keep track of the message in case of failure, and to pass it to the redeliver method. • To read the Failure Q, a failure handler mechanism needs to be written ( can use the MessageRouter Object )
Acquire Mode overview • Acquire mode is typically used to handle requests that are initiated externally, usually from the EIS application itself and to transport this request to the App. Server. • The component that implements Acquire Mode is called MessageRouter • The MessageRouter MDB/EJB can be configured to redirect messages to other JMS Queues using a routing table file and the information in the message header • The MessageRouter MDB/EJB can also be used to handle fail messages sent by the adapter running in Deliver Mode
Acquire Mode overview, cont • By default messages are routed to a default target queue. • MessageRouter can be deployed with an optional file, the routing table • There are two flavors : • An MDB for EAS and BEA • An EJB for Web Sphere
Acquire Mode overview, cont Default Queue (4) MESSAGE ROUTER EJB/MDB ERP/CRM ADAPTER Queue 1 (1) (3) (2) (4) (4) Queue 2 (4) Queue N
MessageRouter deployment • Developers need to create an EJB Jar file to deploy the MessageRouter to the App. Server. • MessageRouter classes are • J2EE 1.3 ( Sybase, WebLogic ), a MDB • com.sybase.aas.ejb.MessageRouterMDB • J2EE 1.2 ( IBM ), a Stateless EJB • Home • com.sybase.aas.ejb.MessageRouterEJBHome • Remote Interface • com.sybase.aas.ejb.MessageRouterEJB • Implementation • com.sybase.aas.ejb.MessageRouter
MessageRouter deployment, cont • MessageRouter Resources Environment References • MessageRouter Resources References
MessageRouter deployment, cont • MessageRouter Environment
Configuring the Routing Table • The routing table is an ASCII file containing one line per routing entry with the format • <APP_GRP>&<MSG_TYPE>=<TARGET_Q> • TARGET_Q must be defined in the deployment descriptor for the MDD/EJB • APP_GRP and MSG_TYPE are stored in the header of the message generated by the ERP/CRM Adapter • These values are defined in the adapter configuration file. • set.msg.options=true • msg.type=<set this to the value from the routing table> • app.group=<set this to the value from the routing table>
Configuring the Routing Table, cont • Routing Table Example • ag1&mt1=JMS_Q_1 • ag1&mt2=JMS_Q_2 • ag2&=JMS_Q_3 • &mt3=JMS_Q_4 • &=JMS_Q_5 //This overrides the DEFAULT_Q
MessageRouter API • No custom method implemented in the MDB • The EJB implements the MessageListener interface, and provides an onMessage () method
Troubleshooting AAS • AAS_DEBUG_FLAG = true • Logs Message Content • Logs Message Header • Logs Message Properties • Check the adapter’s logs, NNSYMessageLog.nml • javax.naming.NamingException are due to missing resources or erroneous resources. Check the EJB resources.