ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Putting messages to the location of the cursor

Post new topic  Reply to topic
 Putting messages to the location of the cursor « View previous topic :: View next topic » 
Author Message
bobjtowers
PostPosted: Fri Aug 05, 2011 2:26 am    Post subject: Putting messages to the location of the cursor Reply with quote

Newbie

Joined: 03 Aug 2011
Posts: 3

Hi there,

Imagine that the order of messages on a queue is important.
It would be a considerable efficiency advantage to be able to update some, but not all messages, on a queue.. without having to read everything from Queue A... update some msgs... then write everything to Queue B.

So perhaps something along the lines of:
-a- browse msg under cursor...
-b- possibly modify the message... then
-c- put the message back to the same position on the queue..
(as indicated by the cursor. Is that possible ?)

or is there another way to achieve the same, or similar effect ?

Thanks to anyone that offers any hints, tips or suggestions

Have a lovely day

Bob
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 05, 2011 3:35 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Imagine that you used a database to hold this data instead of a queue.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Aug 05, 2011 4:43 am    Post subject: Re: Putting messages to the location of the cursor Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bobjtowers wrote:
Imagine that the order of messages on a queue is important.


A concept know as "message affinity".

bobjtowers wrote:
It would be a considerable efficiency advantage to be able to update some, but not all messages, on a queue.. without having to read everything from Queue A... update some msgs... then write everything to Queue B.


It would be even better if the consuming application was redesigned to remove the affinity so message order became irrelevant. Then the entire contents of Queue A would not have to be single threaded through a single instance of the application but could be balanced across n instances.

But to do what you're outlining doesn't exist in WMQ. It's not database software.

Of course, loading Queue A into a database table, doing the updates and reloading Queue A from the database is a simple task. Trivial if you happen to be using a recent version of DB2.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Aug 05, 2011 3:58 pm    Post subject: Re: Putting messages to the location of the cursor Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

You can't modify a message once it's on a queue. You can alter it in MQGET API exits as it makes its way back to the application code, but that's not an easy piece of code to write.

But why update a message? Messages are for state updates, or requests (etc.), not for containing permanent state. Messages are produced and consumed, they are not intended to be contain permanent state.

If you want to update permanent state, send a new message declaring a state update, to be consumed by the system maintaining the state.

Or if you are thinking about using messages as if they were rows in a table in a RDBMS, you would be better off with a RDBMS.


Last edited by mvic on Sat Aug 06, 2011 2:57 am; edited 1 time in total
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Aug 05, 2011 4:18 pm    Post subject: Re: Putting messages to the location of the cursor Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

bobjtowers wrote:
Imagine that the order of messages on a queue is important.

If the order of messages is important, search the WMQ Application Programming Reference and WMQ Application Programming Guide for this topic.

WMQ offers two distinct and different WMQ built-in capabilities, namely: message-grouping and message priority.

Both of these capabilities require that the order be established at the time the message is put to the queue.

Message priority: If this message is more important than the last one, you can change the message-priority value in the MQMD. For retrieval, the message-delivery queue attribute must be set to deliver-by-priority. With the message-delivery attribute not set to deliver-by-priority, messages are delivered out of the queue FIFO. With message-delivery attribute set to priority, messages are delivered FIFO within priority.

Message-grouping: This capability presumes that you build a logical message that consists of multiple physical messages, AND that your application puts them to the queue in a message-group, AND that the messages are ordered in the group by the message-sequence number field in the MQMD.

[edit]
One of my clients needed to reorder (sort?) messages in a queue, and didn't have access to the originating applications (plural).

I suggested they write a one-off app that extracted the messages from the queue, sorted the message data, then put the new messages some other queue. There was no requirement to retain intact the original MD.
[/edit]
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Putting messages to the location of the cursor
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.