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 » .NET client (XMS) GetStringProperty() call fails

Post new topic  Reply to topic Goto page 1, 2  Next
 .NET client (XMS) GetStringProperty() call fails « View previous topic :: View next topic » 
Author Message
mrmanley
PostPosted: Mon Sep 20, 2010 8:45 am    Post subject: .NET client (XMS) GetStringProperty() call fails Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

Websphere MQ V 7
IBM Message Service Client for .NET 2.0.0.2

I am successfully sending a message into a Websphere MQ message queue with SetStringProperty("Foo"). I can look at the message in the queue and see that the property "Foo" exists in the "usr" part of the RFH2 area and with the value I set in my client. But when I browse the messages, the GetStringProperty("Foo") fails! (Returns the empty string.)

Is this a configuration problem on my part? (Again: I've confirmed that the property was set correctly and exists in the queue after the put.)

I'm writing my code as follows:

Code:

IQueueBrowser qBrowser = session_.CreateBrowser(destination_);
            System.Collections.IEnumerator eBrowser = qBrowser.GetEnumerator();
            while (eBrowser.MoveNext())
            {
                    IBytesMessage msg = (IBytesMessage)eBrowser.Current;
                    string strFoo = msg.GetStringProperty("Foo");  // returns empty!
             }


Is there a configuration option that I'm failing to set?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Sep 20, 2010 8:54 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Grand High Poobah

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

mrmanley wrote:
Is this a configuration problem on my part? (Again: I've confirmed that the property was set correctly and exists in the queue after the put.)


What value does "Foo" have? How are you viewing the message? Does the property appear properly via RFHUtil or similar?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mrmanley
PostPosted: Mon Sep 20, 2010 11:20 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

Vitor wrote:
mrmanley wrote:
Is this a configuration problem on my part? (Again: I've confirmed that the property was set correctly and exists in the queue after the put.)


What value does "Foo" have? How are you viewing the message? Does the property appear properly via RFHUtil or similar?


"Foo" just contains some application-specific metadata that I need to get to. Assume in this case that it just contains the word "TESTING". I've verified that the user-defined variable shows up and is populated correctly by using the Websphere queue-monitoring tool. However, when I do a GetStringProperty() on that very same property, it returns the empty string.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Sep 20, 2010 11:35 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Grand High Poobah

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

mrmanley wrote:
"Foo" just contains some application-specific metadata that I need to get to. Assume in this case that it just contains the word "TESTING".


And in this specific case you've confirmed it contains "TESTING"?

mrmanley wrote:
I've verified that the user-defined variable shows up and is populated correctly by using the Websphere queue-monitoring tool.


Which monitoring tool? There are several.

Are you able to cross-check using RFHUtil or other similar application?

mrmanley wrote:
However, when I do a GetStringProperty() on that very same property, it returns the empty string.


How was the property set? I don't mean by SetStringProperty (!), was it another piece of .NET at equivalent level, a JMS-enabled piece of Java, some WMB ESQL, a hand-rolled piece of C code or this monitoring tool of yours?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mrmanley
PostPosted: Mon Sep 20, 2010 1:38 pm    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

ESBWatch (our web-based monitoring tool) confirms that the property "Foo" exists on the message and that TESTING is the value. I don't do any kind of bridging or data-massaging before I send the message. The SetStringProperty() happens in the same process and connection as teh GetStringProperty() (in my test app), so I can rule out any connection/session funkiness.

Vitor wrote:
mrmanley wrote:
"Foo" just contains some application-specific metadata that I need to get to. Assume in this case that it just contains the word "TESTING".


And in this specific case you've confirmed it contains "TESTING"?

mrmanley wrote:
I've verified that the user-defined variable shows up and is populated correctly by using the Websphere queue-monitoring tool.


Which monitoring tool? There are several.

Are you able to cross-check using RFHUtil or other similar application?

mrmanley wrote:
However, when I do a GetStringProperty() on that very same property, it returns the empty string.


How was the property set? I don't mean by SetStringProperty (!), was it another piece of .NET at equivalent level, a JMS-enabled piece of Java, some WMB ESQL, a hand-rolled piece of C code or this monitoring tool of yours?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Sep 20, 2010 2:12 pm    Post subject: Reply with quote

Grand High Poobah

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

What happens if you just ask for property Foo:
Code:
msg.getProperty("Foo");

and inspect the object returned?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mrmanley
PostPosted: Tue Sep 21, 2010 4:34 am    Post subject: Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

The C# binding for XMS does not expose a "getProperty" method. (Remember, I am using the C# XMS library, not the Java binding.) The closest call on the C# IMessage interface is GetObjectMessage(), and it returns null (just like GetStringMethod).

fjb_saper wrote:
What happens if you just ask for property Foo:
Code:
msg.getProperty("Foo");

and inspect the object returned?
Back to top
View user's profile Send private message
mrmanley
PostPosted: Tue Sep 21, 2010 4:36 am    Post subject: Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

Sorry, I haven't had my coffee yet. I meant the GetObjectProperty() and GetStringProperty() calls. Both return null.

mrmanley wrote:
The C# binding for XMS does not expose a "getProperty" method. (Remember, I am using the C# XMS library, not the Java binding.) The closest call on the C# IMessage interface is GetObjectMessage(), and it returns null (just like GetStringMethod).

fjb_saper wrote:
What happens if you just ask for property Foo:
Code:
msg.getProperty("Foo");

and inspect the object returned?
Back to top
View user's profile Send private message
mrmanley
PostPosted: Tue Sep 21, 2010 5:06 am    Post subject: Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

I have also tried to use the PropertyExists() method for the "Foo" property, and it returns FALSE. So the property apparently is not even in the returned object.

mrmanley wrote:
Sorry, I haven't had my coffee yet. I meant the GetObjectProperty() and GetStringProperty() calls. Both return null.

mrmanley wrote:
The C# binding for XMS does not expose a "getProperty" method. (Remember, I am using the C# XMS library, not the Java binding.) The closest call on the C# IMessage interface is GetObjectMessage(), and it returns null (just like GetStringMethod).

fjb_saper wrote:
What happens if you just ask for property Foo:
Code:
msg.getProperty("Foo");

and inspect the object returned?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 21, 2010 5:07 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Grand High Poobah

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

mrmanley wrote:
ESBWatch (our web-based monitoring tool) confirms that the property "Foo" exists on the message and that TESTING is the value.


Not familiar with it I fear.

I'd dot the i by seeing what RFHUtil made of the message. I don't imagine it would do anything other than confirm the existence of Foo with a value of TESTING, but old timers like myself would enjoy the confirmation of this old & friendly piece of free, easily used & trusted software.


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mrmanley
PostPosted: Tue Sep 21, 2010 5:42 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

Okay, I used the RFHUtil to look at the data, and in the usr tab, I see my property "Foo" with a value of "TESTING". So it is there. Would there be any problem due to the fact that it's in the "usr" folder, though? I tried to prefix my property with some other folder "MYDATA.Foo", but the client library threw an exception, saying that the property name was incorrectly formatted.


Vitor wrote:
mrmanley wrote:
ESBWatch (our web-based monitoring tool) confirms that the property "Foo" exists on the message and that TESTING is the value.


Not familiar with it I fear.

I'd dot the i by seeing what RFHUtil made of the message. I don't imagine it would do anything other than confirm the existence of Foo with a value of TESTING, but old timers like myself would enjoy the confirmation of this old & friendly piece of free, easily used & trusted software.

Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 21, 2010 6:09 am    Post subject: Re: .NET client (XMS) GetStringProperty() call fails Reply with quote

Grand High Poobah

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

mrmanley wrote:
Would there be any problem due to the fact that it's in the "usr" folder, though?


No, that's exactly where it should be & is exactly what I'd expect to see in the situation you're describing. So consider the i dotted.

So you're actually getting a null from GetObjectProperty and GetStringProperty?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Sep 21, 2010 6:11 am    Post subject: Reply with quote

Grand High Poobah

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

Ok, let's just cross the t.

Aside from the lack of this property, the rest of the message is exactly as you'd expect? All the message contents are present in the correct format, the other header properties (like put date & so forth) present, correct and retrievable?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mrmanley
PostPosted: Tue Sep 21, 2010 7:04 am    Post subject: Reply with quote

Newbie

Joined: 20 Sep 2010
Posts: 9

Everything in the body of the message looks fine, and the rest of the header data looks fine as well (the JMSX and JMS properties are coming across fine). The GetStringProperty() and GetObjectProperty() calls do indeed return null, not the empty string. And as I wrote before, PropertyExists("Foo") returns FALSE, even though I can plainly see it with RFHutil.

Would there be some kind of flag or setting on the connection that I'm missing? I did have to use this flag on the ConnectionFactory to make the selector logic to work properly:

factory_.SetStringProperty(XMSC.WMQ_PROVIDER_VERSION, "6");

The relevant bulletin is here:

http://www-01.ibm.com/support/docview.wss?rs=171&context=SSFKSJ&dc=DB560&dc=DB520&uid=swg21376626&loc=en_US&cs=UTF-8&lang=en&rss=ct171websphere

Would that be causing problems for my property-reading calls? That seems silly, but I can't think of anything else I did that was out of the ordinary.

Vitor wrote:
Ok, let's just cross the t.

Aside from the lack of this property, the rest of the message is exactly as you'd expect? All the message contents are present in the correct format, the other header properties (like put date & so forth) present, correct and retrievable?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Sep 21, 2010 1:30 pm    Post subject: Reply with quote

Grand High Poobah

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

I'd say open a PMR.
The only other thing I can think of, would be to get an enumeration of the property keys of the message and get the value for each of them.
You might find that you're really not looking for "Foo" but you're looking for "Foo "...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » .NET client (XMS) GetStringProperty() call fails
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.