|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Distinct values in Message broker |
« View previous topic :: View next topic » |
Author |
Message
|
GeneRK4 |
Posted: Wed Feb 12, 2014 5:10 pm Post subject: Distinct values in Message broker |
|
|
Master
Joined: 08 Jul 2013 Posts: 220
|
Hi,
I have a queue with many error messages ,with error reason in MQRFH2.usr folder.I need to design a flow which will provide a list of distinct error reasons (taken from usr folder).
The list ,I can get in any form such as file or a variable or some other means.But I dont want to use Database.
I am not able to think of shared variables which would be shared across all messages running in a flow because,while the messages are running through the flow,if the flow gets stopped for any cause,then the shared variable will loose the data.
If I write in file for each message,it may contain duplicate error reasons.And I guess we need to again fetch the records in the file and find out the distinct errors.
Please suggest some good design for this solution. |
|
Back to top |
|
 |
Gralgrathor |
Posted: Thu Feb 13, 2014 1:52 am Post subject: |
|
|
Master
Joined: 23 Jul 2009 Posts: 297
|
Let the errorhandler flow append *all* the messages to a file (or files, possibly using java.util.logging icm a rolling appender). Then write a second flow that consumes these files on demand, and produces a summary.
On another note: why are you opposed to using a database? Using a database would greatly simplify the solution. It would be similar, only you wouldn't need a second flow: a simple query to the database would be sufficient. |
|
Back to top |
|
 |
Simbu |
Posted: Fri Feb 14, 2014 3:41 am Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
|
Back to top |
|
 |
Gralgrathor |
Posted: Fri Feb 14, 2014 4:36 am Post subject: |
|
|
Master
Joined: 23 Jul 2009 Posts: 297
|
No matter what you use to form the report, you'd still have to have a way to keep a tally of the distinct error messages that have come through. So your code may be part of the solution, but it does not solve the original question.
The original question is solved by keeping a tally either
- in a SHARED variable, with the risk that data is lost at restart
- in a file, with the added problem that you can't keep distinct values in a file
- in a database, which would neatly solve all problems, but for some reason is not to the OP's liking.
If you're going with the file option, then there's two possibilities:
- Consume the file each time a new error comes through, and write distinct values back to it. Additional problems: file locking, etc.
- Or, much simpler: just add the error to the file, and produce a tally on demand. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|