3

I'm new to the Java Connector Architecture (JCA) and the Java Enterprise Edition (Java EE) in general. I have been reading through the JCA 1.6 specifications, but I'm not 100% getting everything.

So here is some questions that I have:

  • Is MessageEndPoint is referring to an Enterprise Information System (EIS)? or is it an application on the server trying to use the message that was obtained from an EIS?
  • Does MessageEndPoint need to be a bean?
  • What does it mean activating a MessageEndPoint?

Can you show some simple example on working/deploying a MessageEndPoint? I'm testing this on WebSphere Application Server - Liberty profile

M. A. Kishawy
  • 5,001
  • 11
  • 47
  • 72
Marko
  • 570
  • 5
  • 21
  • 1
    JCA is usually used to access EIS systems via adapters, provided by vendors or custom developed. It is quite complex feature. Please specify what are you trying to achieve as there may be easier way to do it than JCA. :) If you are just trying to receive asych messages it is better to use JMS and MDBs, rather than JCA. – Gas Nov 02 '14 at 17:44
  • 1
    @Gas I'm trying to understand how the Endpoit in general fits in the world of JCA. I'm working on some JCA project, and switching to other technologies is not an option. The specification document is so dry and doesn't provide enough usage example of stuff like an Endpoint. – Marko Jan 08 '15 at 14:28

1 Answers1

6

Let's clarify some terminologies first:

  • Outbound Messaging is where the message starts from the server (to be more accurate it's initiated from your app which you have on the server, WebSphere Liberty in this case) and end at the EIS.
  • Inbound Messaging is where message starts from the EIS and end at the server.
  • Message Endpoint in general the place where the message end up sitting/getting received at a specific stage of its life cycle.

enter image description here

So with outbound connectivity, we are referring the situation where an application obtains a connection to an external EIS and reads or writes data to it. With inbound connectivity we are referring the situation where the Resource Adapter (RA) listens for events from the external EIS and calls into your application when such an event occurs.

Illustration of an Outbound RA enter image description here

Illustration of an Inbound RA enter image description here

What is a MessageEndPoint mean in JCA?

The application server (ex: WebSphere Liberty) provides message endpoint MBeans to assist you in managing the delivery of a message to your message-driven beans that are acting as listeners on specific endpoints, which are destinations, and in managing the EIS resources that are utilized by these message-driven beans. Message-driven beans that are deployed as message endpoints are not the same as message-driven beans that are configured against a listener port. Message-driven beans that are used as message endpoints must be deployed using an ActivationSpecification that is defined within an RA configuration for JCA (Found in the ra.xml file) .

What does it mean activating a MessageEndPoint?

With message endpoint MBeans, you can activate and deactivate specific endpoints within your applications to ensure that messages are delivered only to listening message-driven beans that are interacting with healthy EIS resources. This capability allows you to optimize the performance of your JMS applications in situations where an EIS resource is not behaving as expected. Message delivery to an endpoint typically fails when the message driven bean that is listening invokes an operation against a resource that is not healthy. For example, a messaging provider, which is an inbound resource adapter that is JCA compliant, might fail to deliver messages to an endpoint when its underlying message-driven bean attempts to commit transactions against a database server that is not responding.

Does MessageEndPoint need to be a bean?

It should. Otherwise you will end up in a big mess by creating your own unconventional way of doing stuff which beat the purpose of following Java EE specification in the first place. Design your message-driven beans to delegate business processing to other enterprise beans. Do not access the EIS resources directly in the message-driven bean, but do so indirectly through a delegate bean.

Can you show some simple example on working/deploying a MessageEndPoint?

Check the second resource I'm mentioning below for a helpful example.

Useful learning resources:

Community
  • 1
  • 1
M. A. Kishawy
  • 5,001
  • 11
  • 47
  • 72
  • Link 1 is broken btw. The thing I've never been totally clear about is how an endpoint ever gets 'deactivated'. Or how an endpoint gets activated dynamically on the fly for that matter. The internet is full of 'examples' of endpoints activated during EAR deployment, and since I've never really needed to know any other method and it's great for teaching you how to get started, I've never pushed the issue. But now I'm at a stage where that's not good enough, and I kind of need to know how to do both dynamic activation and deactivation. – searchengine27 Sep 05 '19 at 20:37