What's the difference between ActivationSpec and ConnectionFactory?

前端 未结 3 555
栀梦
栀梦 2020-12-12 23:33

My understanding is that:

  • MDBs (Message Driven Beans) connect via Activation Specification.
  • MDPs (Message Driven PO
3条回答
  •  再見小時候
    2020-12-13 00:22

    The client of a ConnectionFactory is the application. The application uses the ConnectionFactory to push/pull messages to/from the messaging engine via a Queue.

    The client of an ActivationSpec is the EJB container. The EJB container obtains an ActivationSpec to register a MessageEndpointFactory for the MDB or MDP with a ResourceAdapter. When a client pushes a message to the messaging engine, the messaging engine will use the registered MessageEndpointFactory to forward the message to the application (e.g., the MDB or MDP). This allows the application to "asynchronously" receive messages rather than requiring the client to poll or block trying to pull a message from the Queue.

提交回复
热议问题