Author |
Message
|
mrmanley |
Posted: Mon Sep 20, 2010 8:45 am Post subject: .NET client (XMS) GetStringProperty() call fails |
|
|
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 |
|
 |
Vitor |
Posted: Mon Sep 20, 2010 8:54 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
 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 |
|
 |
mrmanley |
Posted: Mon Sep 20, 2010 11:20 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
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 |
|
 |
Vitor |
Posted: Mon Sep 20, 2010 11:35 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
 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 |
|
 |
mrmanley |
Posted: Mon Sep 20, 2010 1:38 pm Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Sep 20, 2010 2:12 pm Post subject: |
|
|
 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 |
|
 |
mrmanley |
Posted: Tue Sep 21, 2010 4:34 am Post subject: |
|
|
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 |
|
 |
mrmanley |
Posted: Tue Sep 21, 2010 4:36 am Post subject: |
|
|
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 |
|
 |
mrmanley |
Posted: Tue Sep 21, 2010 5:06 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Tue Sep 21, 2010 5:07 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
 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 |
|
 |
mrmanley |
Posted: Tue Sep 21, 2010 5:42 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
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 |
|
 |
Vitor |
Posted: Tue Sep 21, 2010 6:09 am Post subject: Re: .NET client (XMS) GetStringProperty() call fails |
|
|
 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 |
|
 |
Vitor |
Posted: Tue Sep 21, 2010 6:11 am Post subject: |
|
|
 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 |
|
 |
mrmanley |
Posted: Tue Sep 21, 2010 7:04 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Tue Sep 21, 2010 1:30 pm Post subject: |
|
|
 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 |
|
 |
|