message-driven-bean

Pause MDB message Processing

我的未来我决定 提交于 2020-02-23 04:07:13
问题 Can we pause the MDB message processing for some time? For example: Jboss 1-deployed MDB for message processing. Jboss 2:-Bean for gathering user details. If the MDB from jboss 1 calls bean in jboss 2 for getting users details. If this is the case, when we restart the Jboss 2, we need to pause the MDB in jboss 1 till the jboss 2 is UP. Is there any option to pause MDB, so that we can avoid failure of message? 回答1: I doubt you can stop an MDB without stopping the whole application. It is

Tell OpenEJB to ignore MDB

牧云@^-^@ 提交于 2020-01-16 06:20:56
问题 I wrote an unit-test for an activity which finally puts a message into a queue. As soon as a message is put into that queue, a message driven bean starts processing. But I don't want to test MDBs in a unit test. How can I tell OpenEJB to ignore them? I set up OpenEJB with several properties: p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory"); p.setProperty("openejb.deployments.classpath.include", ".*"); p.setProperty("openejb.localcopy",

jBoss deployment of message-driven bean spec violation

人走茶凉 提交于 2020-01-15 18:14:22
问题 I have an java EE application which has one message-driven bean and it runs fine on JBoss 4, however when I configure the project for JBoss 6 and deploy on it, I get this error; WARN [org.jboss.ejb.deployers.EjbDeployer.verifier] EJB spec violation: ... The message driven bean must declare one onMessage() method. ... org.jboss.deployers.spi.DeploymentException: Verification of Enterprise Beans failed, see above for error messages. But my bean HAS the onMessage method! It would not have worked

Can Message driven beans (MDB) listen on “external” MQ?

萝らか妹 提交于 2019-12-25 03:03:04
问题 I am trying to understand concepts related to MDB, MQ, JMS. I did research on SO before asking this question. Is this possible scenario: MDB deployed on Application Server, say on JBOSS (on physical Server-A). MQ (say ApacheMQ) on a difference physical server-B. So can the MDB deployed in physical server-A get messages from physical server-B? If this is possible, then does MDB use JMS API's? I have heard Jboss has MQ, which i presume MQ withing Jboss application server; however i want MDB in

retrieving a value from message listener and print in Main

拜拜、爱过 提交于 2019-12-24 12:34:17
问题 I have 2 EJB app, A and B. A has a stateless session that send a message to app B (Message driven bean). App B send a message back to app A. Now, I have the value I want in the message listener in the stateless session bean in A. But I need to show it from Main. I tried declaring a variable and store the value in it. But when I call it from Main, the value is lost. @Stateful public class AManagerBean implements ejb.AManagerRemote { @Resource(mappedName = "jms/QueueConnectionFactory") private

Stop MDB from receiving messages?

谁说我不能喝 提交于 2019-12-23 17:20:56
问题 I need to programmatically stop a Message-driven bean from receiving messages from a JMS queue. My environment is WebSphere Application Server v7. I think it could be done by some MBean operation on an Activation Specification MBean, but I can't locate the activationSpec using WebSphere's adminclient API. I've browsed the JMX tree using JConsole and also tried printing out every available MBean and searching for the name of the activationspec. It's nowhere to be found. Is this the right

How to set max pool size in MDB on weblogic 10.3

断了今生、忘了曾经 提交于 2019-12-23 12:50:58
问题 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? 回答1: Try using weblogic work manager settings to constrain the number of concurrent threads. The max-threads-constraint can be applied to a work manager set up for the specific MDB (or as part of a pool if you apply it to more than one bean) so, for instance

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

大憨熊 提交于 2019-12-23 12:19:50
问题 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 phrased: Can I use a stateful EJB to pass state around in an asynchronous Event Driven Architecture? 回答1: Yes, it's "legal", but it's nonsensical. MDBs instances are pooled like SLSBs. The MDB will become non-functional after the SFSB times out. It might work to

Destination is mandatory

余生颓废 提交于 2019-12-23 11:57:03
问题 I got following error while deploying my ear in wildfly 8.1.0 server 1)Error: Caused by: javax.resource.spi.InvalidPropertyException: Destination is mandatory", "jboss.deployment.subunit.\"wildfly.ear\".\"wildfly- ejb.jar\".component.ReRattingMDB.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"wildfly.ear\".\"wildfly-ejb.jar\".component.ReRattingMDB.START: java.lang.RuntimeException: javax.resource.spi.InvalidPropertyException: Destination is mandatory 2

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

瘦欲@ 提交于 2019-12-23 11:13:11
问题 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" ) }, mappedName = "jms/dataQ") public class DataMDB implements MessageListener { @Resource(name="jms/dataQueueConnectionFactory") private ConnectionFactory connectionfactory; @Resource(name="jms/dataDestinationQ") private Destination destination; ... } and an XML (ibm-ejb-jar-bnd