English 中文(简体)
如何在未探索之前停止信息处理?
原标题:How to stop message processing before undeploying?

<>9>

  • A JMS message queue.
  • A timer service which puts messages to that queue periodically (from a database).
  • A JEE6 message-driven bean which reads from the queue.
  • The timer service and the message-driven bean are part of different deployment units.

<<>Problem>:

The message-driven bean cannot be undeployed, without breaking the workflow state, as long as messages are work in process. Because of that, we stop the timer service first and wait until all messages are finished.

是否有办法使这种行为自动化? 如果时间服务仍在进行,还是有可能防止不部署? 我们目前正在使用JBos 4.2.3。

Non-Solutions:

  • Refactoring the deployment units, because it would involve several departments.
  • I know that a system crash won t be covered and that a bulletproof solution should include a recovery strategy.
最佳回答

每一个部署的MDB都有一个JMX管理界面。 甲型六氯环己烷的用途因部署不同而异(而且可能也不同联Bo的版本)。 我正在使用JBos4.3,目标格式是:

Domain Name:    jboss.j2ee
service:    EJB3
name:   <MDB Name>
ear:    <EAR Name>  (if applicable)
jar:    <JAR Name>

如果您的职称是JBosss ServiceMBean,请您利用JBosss 通知在时间上填写<<><>>。 这将迫使时间服务在多边开发银行开始之前开始(最好是使时间服务出现某些员额的延迟),但更重要的是,我believe倒转将在不远的地方进行,而时间服务应当首先停止,即多边开发银行。

如果这项工作能够进行,但我不认为你会迫使多边开发银行在行时间时不会感到不快。 你的申请细节可能不支持这一点,但你可能考虑解决这一问题的一种方式是使用, 基本上将时间和信息处理器捆绑在一起(例如,一个多边开发银行,但接收时间较长的事件,而不是电文),使你不必在两个组成部分之间安顿。

================================ Attempt #2 ================================

因此,你想要阻止多边开发银行停止工作,而喂养点的深度超过零。 这种做法应当为你工作,尽管对博爱来说是很具体的。

  1. Implement a JMX NotificationListener that listens on state changes of the MDB Delegate MBean.
  2. You can also implement a JMX NotificationFilter to narrow down the specific events you want to listen on.
  3. The state change you re looking for is on the attribute State and the transition you re looking for is 3 --> 1 (Started --> Stopping)
  4. JMX notifications in [this version of] JBoss are issued synchronously and will block until the notification listener returns. When your listener receives this notification, start a polling loop on the MDB s feeding queue MBean (did not ask if you were using JBoss Messaging but I will assume you are). While the MessageCount is > 0, you keep polling. When the queue s message count is zero, the listener returns and the MDB will stop.
  5. Make sure to add a brief sleep in your polling loop, as well as a polling timeout (in case things get whacky).
  6. You might also consider not returning until the message count is 0 for at least n polling loops in case there is some uncommited message in transit which might not show up in the message count.

底线是,虽然你的属性变化听众被叫作,但电文将继续处理。 当“主人”的听众返回时,多边开发银行会停止。

如果您的初测评估系统是本地的低温测距仪表态,则电离层电离层电离层值将可在中转。 对于任何其他安排,您可能需要发出专有的JMS 2008/6号呼吁,以获取电文,或采用更为简明的武力办法,你可以简单地要求使用JMS QueueBrowser,并计算电文数。

问题回答

暂无回答




相关问题
VS 2008 : How to publish with out DLLs?

I have developed a web application in Visual Studio 2008 and want to publish it in to the production server. I see a publish option there.But its producing files with DLL. I dont want to publish only ...

Apache: Deploying a new site to the server

I have a site currently live on a domain. I would like to switch it to a new site, that is currently in a password protected sub directory on this server. I have a "Site Maintenance in Progress" page....

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Pylons deployment questions

I m a beginner with Pylons and I ve mostly developed on my localhost using the built-in web server. I think it s time to start deployment for my personal blog, I have a Debian Lenny server with ...

Do I want Publish or Release Build in VB.net?

I wrote a little (like 40 lines little) Winforms application with VB.net in Visual Studio 2010. Now I ve released the code as a Google Code project. It s easy for a developer to get the source but I d ...

Need advice on my PHP development solution

Here is how our current php development solution is set up: Each developer work on their local machine. Each developer commit their change to a common SVN server (intranet). A commit hook upload the ...

loading from JAR files during deployment vs development

when i am loading some data into my java program, i usually use FileInputStream. however i deploy the program as a jar file and webstart, so i have to use getRessource() or getRessourceAsStream() to ...

热门标签