Pause MDB message Processing - jboss

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?

I doubt you can stop an MDB without stopping the whole application. It is possible with Spring JMS, but not with regular message driven beans.
What you could do, and is apparently possible, is pausing a queue. HornetMQ does give you the possibility to switch the queue to "receive only mode", though I don't know if this is available via the admin console.

In JBoss (4.x and 5.x), you can look up the MDB through the JMX Console and pause delivery of messages.
Go to the jmx console (http://yourserver:8080/jmx-console/ where 8080 is the HTTP port)
Click jboss.j2ee in the left-hand pane
In the right-hand pane, find and click on your MDB. Usually, it will look something like
jar=file-containing-your-MDB.jar,name=NameOfYourMDB,service=EJB3
To pause, click the "Invoke" button next to "stopDelivery"
To resume, click the "Invoke" button next to "startDelivery"

You can stop the Queue on HornetQ. (I'm not sure about JBoss Messaging, but I'm pretty sure you do)
Look for the message pause and resume on the JMX Console

Related

How to stop MDB when JBoss cannot process the message because of other system's failure

I'd like to know how to stop/start message listener when some environmental problem happens (ex. Remote Server which called by webservice is down).
In this case message listener continue trying to read message and get exception when it tries to connect webservice. It will rollback the queue retry without any break.
How can I stop or slow down message listener. I use JBoss EAP 6.
Thanks a lot.
It seems like sleep thread some time would be best solution in my case.
Simple thread.sleep(mill) is not recommended and use #Asynchronous and Future is recommended, as far as I found through googling.

BPEL Designer for Eclipse: how to debug a BPEL process

I'm trying to debug a BPEL process. I made it using BPEL Designer for Eclipse (3.7.2), i'm using Ode 1.3 as engine.
I have no idea how to debug my process. I can deploy it on ode in a debug session but I don't really understand what can i do after that.
You can deploy BPEL processes developed in WS-BPEL 2.0 standard on WSO2 BPS server.
Once you deploy the BPEL process on WSO2 Business Process Server, you can use following mechanisms to debug/troubleshoot failures.
1.Using Message Tracer. This enables you to view the inbound and outbound messages to and from BPS server. To enable message trace logs for BPEL processes;
Add the following entries to the $CARBON-HOME/lib/log4j.properties
log4j.logger.org.apache.ode.bpel.messagetrace=TRACE log4j.logger.org.wso2.carbon.bpel.messagetrace=TRACE
The preferred log4j appender should be configured such that it has a threshold of TRACE level. If CARBON_LOGFILE is the log4j appender, it should be changed as follows. By default this is set to DEBUG.
eg - log4j.appender.CARBON_LOGFILE.threshold=TRACE
Re-start the server.
2.Using the Event table in the 'Instance Information' page (Figure 1). Each and every activity should have 3 events upon the successful execution. If an activity only has 2 events or if it has an "ActivityFailureEvent", then something must have gone wrong within that particular activity. You may need to refer the log file of WSO2 BPS server in-order to further investigate on the issue.
Unfortunately, the open source tools for BPEL debugging are very limited. Although ODE provides APIs to suspend and resume processes at break points, the current tools don't make use of it. I'd recommend to enable the DebugBpelEventListener, which outputs the execution events to the configured logger. This usually helps to understand what is going on.

Where to configure the org.jboss.ejb3.mdb.MdbDelegateWrapper

I need to reduce the pool size of an MDB to 5 because it connect to an external resource that is limited in terms of connections. If I have 15 messages in my JMS queue, then only 5 msg are process successfully and the other 10 are waist because of connection error happening in the MDB code.
I show this setup in the Jboss JMX-console:
I'm using Jboss 4.2.3. I need to know where I can edit this MaxPoolSize config. I searched everywhere but haven't found it.
Thanks
I guess adding the limit in 'instance-pool' in Jboss.xml should do it.
Check this blog article and Jboss docs to see how to use 'instance-pool' and 'strictMaximumSize'

MSMQ cannot delete or purge a queue

I'm very new to MSMQ.
We have a critical system using MSMQ and it is not able to start due to insufficient resources. It appears that MSMQ is at capacity.
I am trying to purge messages (or even delete unneccessary queues), but I receive the following error when purging:
Cannot delete all messages from queue.
Error: Access to Message Queuing system is denied.
What are my options? Is there a way to delete queues when the services is off?
There's an easier way:
Open Computer Management on the machine,
expand the Services and Applications node (Features on 2008),
expand the Message Queuing service,
expand the private queues folder,
expand the private queue you're working with,
right click onto the queue messages folder and
click the purge option.
I think there is rights issue.
You are not able to give rights then do following step for forcefully delete queue.
Stop following services
Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.
Go to C:\Windows\System32\msmq\storage\lqs
Now open file in notepad or notepad++ and
see the name of queue at QueueName=\private$\YourQueueName
Before delete file backup the file. Now delete that file.
Don't delete other file which does not have your queue name.
Do these things as your own risk.
Now start following services
Message Queuing Triggers,
Net.Msmq Listener Adapter
Message Queuing.
This trick work for me...
If you open Computer Management on the machine, expand the Services and Applications node (Features on 2008) and right-click on the Message Queuing service.
Right click on the Properties option and open it up to the General tab.
You can specify storage limits for messages -- you may have ran into the upper limit for messages storage. If you temporarily increase this value, it may allow you back into the messaging system so you can purge out those queues and restore operation.
Failing that, if you can deal with the loss of the messages (which if you are trying to purge I presume is okay), maybe delete the queue and recreate it.
Get hold of a copy of Queue Explorer - it's a commercial app but the trial is fully functional and it's worth it's weight in gold when debugging MSMQs http://www.cogin.com/mq/
If you don't have permissions though, then you don't have permissions! Are you a box admin? If you go to computermanagement and right click on one of your privete queues and select properties can you access the security tab and edit/see the permissions there?

How do I delete messages from MSMQ using the Computer Management tools in Windows XP

Computer Management -> Services and Applications -> Message Queues
How to delete a message from a specific queue?
It seems to me there was some way but I cannot find it right now.
In Windows 10 you can empty a queue in Computer Management --> Services and Applications --> Message Queuing by right-clicking the queue and selecting All Tasks --> Purge:
Well, it isn't possible to delete a poison message by MMC.
You can try QueueExplorer and maybe that will help you out, or you have to programmically to solve your issues