Questions tagged [message-driven-bean]

A message-driven bean is an enterprise bean that allows J2EE/Java EE applications to process messages asynchronously.

A message-driven bean is an enterprise bean that allows J2EE/Java EE applications to process messages asynchronously. It acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. The messages may be sent by any J2EE/Java EE component, or by a JMS application, or a system that does not use Java technology at all.

Resources:

436 questions
5
votes
2 answers

Can we use ejb-jar.xml instead of annotations for MessageDrivenBean(MDB) in EJB 3.0?

I've configured the message destination type, name etc using @ActivationConfigProperty in EJB 3.0 but I wanted to configure the MDB using deployment descriptor (ejb-jar.xml) as in EJB 2.0. FYI: I'm using JBoss 6 Can anyone guide me on this?
5
votes
3 answers

Making maxSession property configurable for a specific MDB in JBoss EAP 5.1

How to make maxSession value for an MDB user-configurable? There is an MDB that listens for a message from a specific queue. It is defined as an annotation. @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "5"). In order to…
Prasenjit
  • 51
  • 1
  • 3
5
votes
2 answers

How to read messages in an order from the Queue using MDB?

I have a MDB which listens to WebSphere MQ. It does not picks up the messages in the order that has been received by the Queue. How can i make it read it in that order? Is it possible? Should i not use a MDB.
5
votes
4 answers

using amazon sqs in a @MessageDriven bean - pooling / parallel processing

We need to use queues in our Java EE application and since it is a cloud base application (deployed on OpenShift Online), we like to use amazon sqs. If I understand the theorie of the receiving part of JMS / Java EE correctly, a @MessageDriven bean…
badera
  • 1,230
  • 17
  • 42
5
votes
1 answer

How to configure Java Message Driven Beans and Websphere Activation specification without hardcoded JNDI Names?

We have a MDB listening to a Queue reading data and sending data to another Queue @MessageDriven( activationConfig = { @ActivationConfigProperty( propertyName = "destinationType", propertyValue = "javax.jms.Queue" )…
naamadheya
  • 1,650
  • 3
  • 18
  • 26
4
votes
1 answer

How to set max pool size in MDB on weblogic 10.3

I need to set the max pool size on a MDB on weblogic 10.3. I inserted this annotation on MDB directly @ActivationConfigProperty(propertyName="MaxPoolSize", propertyValue="1")}) but it seems not to work. Is there any other option to set?
Massimo Ugues
  • 4,057
  • 7
  • 39
  • 55
4
votes
5 answers

How to build a auto reply JMS listener in JUnit (in OpenEJB)

I have a EJB to send a message to JMS queue and wait the reply from it. I want to test the EJB, it's easy to use OpenEJB to do the JUnit test of the EJB. But the problem is this EJB will wait the JMS response to continue process. Although I can send…
Dennys
  • 561
  • 2
  • 11
  • 32
4
votes
3 answers

Exception Deploying EJB Jar to Glassfish

This is my first foray into using JMS. I have a successfully created/deployed a war file that contains a servlet that I can use to upload files. When a file is uploaded it sends a message to a JMS queue. Next I wrote a listener to retrieve the…
sdoca
  • 7,402
  • 21
  • 65
  • 119
4
votes
2 answers

Is it legal to inject a @Stateful into an MDB?

Is it legal to inject a @Stateful into an MDB? @Stateful public class InteruptBean implements Interrupt { .... } @MessageDriven(...) public class EchoTrigger implements MessageListener { @EJB Interrupt interrupt; .... } Or better…
Jonathan S. Fisher
  • 7,058
  • 6
  • 37
  • 78
4
votes
4 answers

Spawning new java threads with in Message Driven Bean ( MDB)

Can I start /spawn new java thread from within a MDB? I have a requirement to do some parallel processing from code in MDB and then return the control back to MDB. Requirement: Message come to MDB , then some processing of code. Then two new slave…
4
votes
2 answers

Configuring an MDB to listen to multiple queues

I'm using EJB 3.1 and I want to configure an MDB to listen to multiple queues. I'd prefer defining the queue names via XML but the other definitions via annotations. Can this be done?
Ittai
  • 4,835
  • 11
  • 54
  • 90
4
votes
2 answers

DI in an EJB/MDB Application

I'm currently developing a small EJB application running on IBM Websphere Application Server 7 (Java EE 5). The app mainly consists of one MDB listening for incoming MQ messages which are transformed and stored in a DB. Currently I'm using a lot of…
Leikingo
  • 730
  • 2
  • 7
  • 18
4
votes
2 answers

How to stop rollback in MDB?

I have a onMessage method where I'm reciving an ObjectMessage from the Queue and using that information to populate and persist a JPA entity object. But when something goes wrong while persisting the entity object it is re-executing the onMessage().…
Ravi
  • 7,329
  • 13
  • 38
  • 42
4
votes
2 answers

How to restrict pool size of MDB on Glassfish v3

my Message Driven Bean executes highly intensive operations so I would like to restrict it's pool size or my server would have been overloaded. I have tried this ( code ) but it doesn't work, it's pool is still 32 ( empirically tested, time to time…
Gaim
  • 6,289
  • 4
  • 35
  • 58
4
votes
1 answer

How does CDI injection work in MDBs and @Scheduled beans?

I'm working on a large Java EE 6 application that is deployed on JBoss 6 Final. My current tasks involve using @Inject consistently instead of @EJB, but I'm running into some problems on some types of beans, specifically @MessageDriven beans and…
1
2
3
29 30