[Management, JMX/JBoss] - Monitoring single notification sent when expecting multiple
by bhuste1
I have configured a threshold monitoring mbean to monitor the QueueDepth on a JMS queue. When the QueueDepth is greater than 500, I have registered to receive a notification on the ConsoleAlterListener.
The problem I am facing is that I only ever receive the notification one time when the QueueDepth exceeds 500. The depth will go back down below 500 and minutes later it will again exceed 500 but a notificaiton is NOT sent. I did notice that if I clear the alert from the web-console then the notification will be sent again but only if you clear it each time it appears. Is there anyway to receive the notification each time the condition occurs?
Below is my config for the threshold monitor.
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.monitor.ThresholdMonitor"
| name="jboss.monitor:service=SlaveQueue_Monitor">
| <attribute name="MonitorName">SlaveQueue Monitor</attribute>
| <depends optional-attribute-name="ObservedObject">jboss.mq.destination:service=Queue,name=slave</depends>
| <attribute name="ObservedAttribute">QueueDepth</attribute>
| <depends-list optional-attribute-name="AlertListeners">
| <depends-list-element>jboss.alerts:service=ConsoleAlertListener</depends-list-element>
| </depends-list>
| <attribute name="Threshold">500</attribute>
| <attribute name="Period">2000</attribute>
| <attribute name="CompareTo">-1</attribute>
| <attribute name="Enabled">true</attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964119#3964119
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964119
19 years, 9 months
[EJB 3.0] - EJB 3 Entity persist and merge bug?
by jlowcock
I have a simple entity that uses a generated primary key. If I simply persist the entity every thing works in terms of the database however the generated primary key value is not set in the class instance I have persisted. If I persist and then merge the result the generated value is then set in my class instance however there are two row created in the database one for the first scenario and then one for the second scenario. This implies to me that the persist operation is creating an internally cached version of the class which is then merged/copied when I call the merge operation.
Is there an operation I need to call after persist, or an additional annotation, or what, in order to have the generated value appear in the class instance without having to call merge.
Is the behaviour of the persist/merge combination a bug in that it creates two rows in the database?
Here is the code for my entity.
@Entity (name = "P002Ledger")
@Table (name = "P002_LEDGER")
public class Ledger
implements Serializable
{
static final
private long serialVersionUID = -147023002293214496L;
static final
private Reporter _reporter = Reporter.getReporter(Ledger.class);
private long m_code;
private String m_name;
public Ledger ()
{
}
public Ledger (long code)
{
m_code = code;
}
public Ledger (String name)
{
m_name = name;
}
@Id
@SequenceGenerator(name="p002_ledger_code_seq", allocationSize=25)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="p002_ledger_code_seq")
@Column (name="ledger_code",nullable=false)
public long getCode()
{
return m_code;
}
protected void setCode(long code)
{
m_code = code;
}
@PostPersist
protected void askCode()
{
_reporter.trace("code = "+getCode());
}
@Column (name="ledger_name",nullable=false)
public String getName()
{
return m_name;
}
public void setName(String name)
{
m_name = name;
}
}
This is the code I have used to generate the persist/merge scenario. The service methodsare simple wrappers around em.persist and em.merge.
Ledger ledger = new Ledger("Gen Barry");
service.insertLedger(ledger);
assertTrue(ledger.getCode() == 0);
ledger = service.updateLedger(ledger);
assertTrue(ledger.getCode() != 0);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964116#3964116
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964116
19 years, 9 months
[JBoss jBPM] - Re: Programmatically creating workflows
by kbarfield
"jmjava" wrote :
| I don't know alot about JBPM at the moment and i'm not sure JBPM is the product for us - we may need something more flexible. It sounds like JBPM is designed to be used in a set manner. I think we may need something more flexible.
|
jBPM is very flexible, and can do what you are describing. kukeltje was just warning to make sure your solution would be maintainable in the long term. I can see a couple of different ways of doing this:
1. Break the overall process into several sub-processes. These sub-processes are then called by the "master" workflow. This would give you greater independence with editting each sub process.
2. Are the actual customizations you need changing the fundalemental flow of the process? For instance, are you going from a process that was A>B>C to H>Q>U>V? Or is it the case that the process variables and who gets assigned tasks what is changing? The later case is more of what we see, and for these types of cases you can use JBoss Rules with jBPM and have the rules be different for the different scenarios, not the underlying process definition.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964115#3964115
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964115
19 years, 9 months