Hi I have added this code
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=myQueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
to my /server/default/deploy/jms/jbossmq-destinations-service.xml
The queue works fine...
but where do i see the messages posted to the queue.
You can use the jmx-console to view the messages in a queue. What you should look at is jboss.messaging.destination on the left hand side. If you can't find it, use jboss.messaging.destination:* as the objectfilter and search.
Once you find your Queue, you can see attribute MessageCount that shows your the current messages in the queue.
Related
I want to return statsu = success
After Kafka consumer read all massage in that day, it must to running all the time.
I tried to google it but not found any solution but if you have any link or something to resolve it, please share it back to me.
See https://docs.spring.io/spring-kafka/docs/current/reference/html/#idle-containers
While efficient, one problem with asynchronous consumers is detecting when they are idle. You might want to take some action if no messages arrive for some period of time.
You can configure the listener container to publish a ListenerContainerIdleEvent when some time passes with no message delivery. While the container is idle, an event is published every idleEventInterval milliseconds.
And
https://docs.spring.io/spring-kafka/docs/current/reference/html/#event-consumption
You can capture these events by implementing ApplicationListener — either a general listener or one narrowed to only receive this specific event. You can also use #EventListener.
I am working on a project that "sniffs" (intercepts) all messages that are being send through ESB.
I use JBoss AS 6 with ESB 4.11. I am sending both esb-aware and JMS messages and everything works, but it seems that my interceptor intercepts every message mulptiple times.
At the moment, the Interceptor class just prints the concent + some other stuff to console. When I send a message, it displays the sent message multiple times (3 times to be more specific).
So my question is: Why?. Is this normal behavior? I have no clue where the mistake could be. I think that is could be one of these two options:
1) I have some error in my sending class, but I dont think thats the issue, since I use simply one serviceInvoker and my code is very similar to sample quickstarts. Standard output from gateway listeners also indicate that message is sent only ones...
2) Pipeline Interceptor intercepts the message multiple times, every time at a different stage of the pipeline. But how to test if this is the issue?
My properties file section for interceptors looks like this:
<properties name="interceptors">
<property name="org.jboss.soa.esb.pipeline.failure.interceptors" value="interceptor.Interceptor"/>
<property name="org.jboss.soa.esb.pipeline.instantiate.interceptors" value="interceptor.Interceptor"/>
<property name="org.jboss.soa.esb.pipeline.start.interceptors" value="interceptor.Interceptor"/>
<property name="org.jboss.soa.esb.pipeline.end.interceptors" value="interceptor.Interceptor"/>
</properties>
I tried to delete some of the properties but then it either doesnt intercept anything at all or it triggers multiple times!
Thanks for any tips!
JBossESB is not a very popular topic here :D
Eventually, I figured it out (I got helped on Jboss community forum). The problem is apparently a bug which is fixed in the next version of ESB. I hope this answer helps someone eventually...
Here is the link to the bug:
https://issues.jboss.org/browse/JBESB-3876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
I have two very basic questions on WebSphere MQ - given that I had been kind of administrating it for past few months I tend to think that these are silly questions
Is there a way to "deactivate" a
queue ? (for example through a
runmqsc command or through the
explorer interface) - I think not. I
think what I can do is just delete
it.
What will happen if I create a
remote queue definition if the real
remote queue is not in place? Will
it cause any issues on the queue
manager? - I think not. I think all
I will have are error messages in
the logs.
Please let me know your thoughts.
Thanks!
1 Is there a way to "deactivate" a
queue?
Yes. You can change the queue attributes like so:
ALTER Q(QUEUE_NAME) PUT(DISABLED) GET(DISABLED)
Any connected applications will receive a return code on the next API call telling them that the queue is no longer available for PUT/GET. If these are well-behaved programs they will then report the error and either end or go into a retry loop.
2 What will happen if I create a
remote queue definition if the real
remote queue is not in place?
The QRemote definition will resolve to a transmit queue. If the message can successfully be placed there your application will receive a return code of zero. (Any unsuccessful PUT will be due to hitting MAXDEPTH or other local problem not connected to the fact that the remote definition does not exist.)
The problem will be visible when the channel tries to deliver the message. If the remote QMgr has a Dead Letter Queue, the message will go there. If not, it will be backed out onto the local XMitQ and the channel will stop.
Hi I have design/architecture question. I would like to send emails from one of my jsp pages. I have one particular issue that has been a little bit of a problem. there is an instance where one of the pages will need to send around 50 emails at near the same time. I would like the messages sent to a queue where a background thread will actually do the email sending. What is the appropriate way to solve this problem? If you know of a tutorial, example code or tomcat configuration is needed please let me know.
Thanks,
Your solution is rather sound: append the messages to a internal queue and then let some background task handle them.
Here are a few pointers that may be useful:
Unless you want to go distributed (in which case you should look at JMS), use a BlockingQueue implementation for your queue. In your background thread, just do an infinite loop while take()-ing messages from the queue. Those classes take care of potential concurrency issues for you.
Use a ServletContextListener to set up your background thread when your Web application starts and when it is stopped.
One possible problem with using a raw BlockingQueue is that when your Web application is stopped, all the messages in the queue are lost. If that's a serious problem, then it would probably be easiest just to use a database for the queue and to use notify() to wake up your background thread, which then processes all requests from the database.
I am using C# and .Net Framework 1.1 (yes its old but I inherited this stuff and can't convert up). I places messages on a transactional queue but it does not get on the queue about 50% of the time. Running workgroup and Windows/XP Professional with all service packs installed. I don't see any messages in the dead letter queue either.
Any ideas where to look?
If it isn't hitting the queue at all and isn't going to the dead-letter queue, it suggests the item isn't being sent to the queue. You should be able to confirm that this is the case by switching on the journal for the queue.
Assuming it isn't hitting the queue, it is probably a transaction issue. I would check that you are definitely committing the message to the queue every time. Make sure there aren't any exceptions being thrown and swallowed that causes the transaction to roll back or never be committed (essentially the same thing). Also make sure there aren't any conditional statements that mean the commit gets skipped.
I would add some logging around every location where a transaction is started, committed and rolled back and also around any location where you are creating a message. You can then review you log to see the order of events and see what's going astray.
Another option would be to remove all of the transaction code and test the code against a non-transactional queue. If the messages all appear then it is a transactional problem. If not, the issue is elsewhere.
I use MSMQ a lot and the one thing I have learned through experience is that it works really well and the weak point is me :-)