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 » IBM MQ Java / JMS » JMS, sending a message & setting the JMSTimestamp

Post new topic  Reply to topic
 JMS, sending a message & setting the JMSTimestamp « View previous topic :: View next topic » 
Author Message
jhalstead
PostPosted: Fri May 19, 2006 3:49 am    Post subject: JMS, sending a message & setting the JMSTimestamp Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

Just a quick one, I've got a colleague who is taking a message off a queue & putting on to another. He's using JMS to do this. The crux of his problem is that the JMSTimestamp is getting reset when the message is put. In the usual MQI world you get around this with the message context settings - however I couldn't see anything similar in the JMS docs. I see there is a setJMSTimestamp method - however by the looks of things this gets overwritten by the send method.

Can aybody confirm of deny this for my me?

I guess the alternative is to get him using the JAVA API, however this is a bit of a departure as everything else they've done uses JMS....

Thanks

Jamie
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Fri May 19, 2006 8:09 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Looking in the manual:
Quote:
setJMSTimestamp

public void setJMSTimestamp(long timestamp) throws JMSException;
Sets the message timestamp.

Providers set this field when a message is sent. This operation can be used to change the value of a message that has been received

Based on the comments, I'd say it worked like MessageID. The set only affects messages you've already read, and not messages you're trying to put.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri May 19, 2006 8:45 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Quote:
This operation can be used to change the value of a message that has been received
so why would anyone want to do that?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
jhalstead
PostPosted: Fri May 19, 2006 10:00 am    Post subject: Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

As I understand it all that the involved component is required to do is to get a message off a queue and put it to another queue. The reason for this components existence is to provide throttling functionality (i.e. configure the pool sizes in app server to control maximum throughput) the aim being to avoid backend getting mashed if a DOS attack is somehow initiated.

As I understand it an MDB is picking up the message and subsequently putting it to a queue using JMS. A fundamental requirment is that the underlying date and time stamps in the headers remain the same. However the behaviour he is experiencing is that he cannot pass the input messages timestamp on to the output message.

I hope this puts the initial question in context a little further.

Does this sound like its unachievable using JMS?

Thanks for your help and consideration so far.

Jamie
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sat May 20, 2006 5:36 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

It sounds like JMS is just overkill. Use the plain MQ api.

Also, I've had to do this kind of throttleing before. It was a bad idea then, and it's a bad idea now.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jhalstead
PostPosted: Sun May 21, 2006 5:37 am    Post subject: Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

Thanks Jeff. The reason that JMS is in the mix is that all the other message based interfaces implemented as part of his work use JMS... In this context I guess it make sense for them to try and stick to JMS if they can.

I've already pointed him at the Java API. I guess the pros of JMS - open, standard based, vendor/platform neutral introduce some cons - for instnace less control over functionality provided by the underlying message transport provider.

If anybody has a flash of JMS inspiration and thinks that controlling the JMS timestamp when sending a message is possible - please do post!

Thanks Again!

Jamie
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Sun May 21, 2006 5:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Are you really willing to introduce an extra put and an extra get into the business flow, in order to protect against a (should normally be extremely rare) DOS type of flood of messages?

Is there a queue manager that the WAS applications talk to, that is different than the backend queue manager?

If so, you may be able to tune (well, maybe detune!) your channels such that they will provide the same kinds of "slow things down" measures that you're after.

Or a channel exit could do it, definitely.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jhalstead
PostPosted: Sun May 21, 2006 7:35 am    Post subject: Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

Thanks for all your concern about the design. I will of course pass this on to my colleague when I speak to him on Monday.

The historry as I understand it was that the client required a mechanism to limit throughput, expecially where services were exposed to web channels - obviously many precations are already in place to ensure the authorisation and authentication of any consumers.

Now this throttler (already in place) is sadly changing the date stamps on the messages - which is a problem ... hence the request to see if anyone knew how to preserve the JMSTimestamp (or set it when putting a message!).

Love the ideas about controlling throughput with WMQ config, however - with the very greatest respect - I'm not trying to give this guy new ways to do things - I'm just trying to help him fix what he's already got. (Aren't I short sighted!)
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Sun May 21, 2006 7:59 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
Location: LI,NY

If it is just a concern about passing the information to the destination his program could use a user folder in the RFH2 to do that.

You could then compare the two values -- original one vs the one set by the move utility...

Yes it would mean changing a little bit the programing and the logic and handling the fact when the user defined property is not on the message...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
briancop
PostPosted: Mon May 22, 2006 2:10 am    Post subject: Reply with quote

Apprentice

Joined: 04 Apr 2005
Posts: 28
Location: Hursley, UK

A JMS message producer can be configured to disable message timestamping (typically to save the overhead of generating them). This is a hint to a JMS provider which it can choose to accept or ignore, but you could try it. Call MessageProducer.setDisableMessageTimestamp(true) when you create your producer and see if that changes anything. The result could be:
1) Exactly what you want - message timestamp is unchanged from whatever is already in the message
2) Message timestamp is set back to 0
3) Message timestamp is set to current time (i.e. hint is ignored)
but it is worth a try.

Other than that, I don't know of a way of preventing MQ from setting the timestamp when using JMS.

Brian
Back to top
View user's profile Send private message
jhalstead
PostPosted: Fri May 26, 2006 8:51 am    Post subject: Reply with quote

Master

Joined: 16 Aug 2001
Posts: 258
Location: London

Forgot to close the loop on this one. Sadly using the setDisableMessageTimestamp(true) approach made no discernable difference... Ayway - Java API was used, and he had to build MQRFH & assocaited JMS folders to make it look like a propper JSM message. Such is life.
Thanks for the suggestions.

Jamie
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS, sending a message & setting the JMSTimestamp
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.