|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ v7 = Teh Strange! |
« View previous topic :: View next topic » |
Author |
Message
|
friedl.otto |
Posted: Fri Feb 20, 2009 3:14 am Post subject: MQ v7 = Teh Strange! |
|
|
Centurion
Joined: 06 Jul 2007 Posts: 116
|
After running into some SSL client-channel surprises here, I have finally
gotten some time to attempt a little Java application. Lo and behold, I get
some surprises with MQEnvironment and MQC in my IDE, and download
some Cresida basics, just to test.
This:
Code: |
~ > javac -Xlint:deprecation -cp /opt/mqm/java/lib/com.ibm.mq.jar:. MQRead.java |
Yields this:
Code: |
MQRead.java:121: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED;
^
MQRead.java:121: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED;
^
MQRead.java:121: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_SHARED;
^
MQRead.java:141: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT;
^
MQRead.java:141: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT;
^
MQRead.java:141: warning: [deprecation] com.ibm.mq.MQC in com.ibm.mq has been deprecated
getOptions.options = MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_CONVERT;
^
Note: MQRead.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 warnings |
And this:
Code: |
~ > javac -Xlint:unchecked -cp /opt/mqm/java/lib/com.ibm.mq.jar:. MQRead.java |
Yields this:
Code: |
MQRead.java:76: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable
params.put(args[i], args[i+1]);
^
Note: MQRead.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 warning |
After a quick Google survey, I didn't find much of use aside from this
obliquely related post.
Any JavaGawds out there who know how BigBloo want us to do it now,
since the WMQ7 InfoCenter isn't exactly forthcoming with sections
like: "This is what used to work ... but we felt you needed a change!" _________________ Here's an idea - don't destroy semaphores unless you're certain of what you're doing! -- Vitor |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 20, 2009 3:28 am Post subject: Re: MQ v7 = Teh Strange! |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
friedl.otto wrote: |
Any JavaGawds out there who know how BigBloo want us to do it now,
since the WMQ7 InfoCenter isn't exactly forthcoming with sections
like: "This is what used to work ... but we felt you needed a change!" |
By no stretch of the imagination could I be described as a JavaGawd, JavaDemiGawd or indeed JavaMostlySavy, but Mr Google and I found this which says:
Quote: |
com.ibm.mq
Interface MQC
--------------------------------------------------------------------------------
Deprecated. Using this class is not recommended. The com.ibm.mq.jmqi.constants class should be used instead. |
This would seem (to my inexperienced eye) to be a clue that BigBloo want you to use this jmqi thing in place of this MQC thing.
Of course, could be utterly wrong. See above re: my Java knowledge  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
friedl.otto |
Posted: Fri Feb 20, 2009 3:41 am Post subject: Re: MQ v7 = Teh Strange! |
|
|
Centurion
Joined: 06 Jul 2007 Posts: 116
|
|
Back to top |
|
 |
friedl.otto |
Posted: Fri Feb 20, 2009 3:57 am Post subject: |
|
|
Centurion
Joined: 06 Jul 2007 Posts: 116
|
I guess this:
http://www-304.ibm.com/jct01005c/isv/tech/sample_code/mq/mqhash.java
which when compiled:
Code: |
javac -Xlint:unchecked -cp /opt/mqm/java/lib/com.ibm.mq.jar:/opt/mqm/java/lib/com.ibm.mq.jmqi.jar:. mqhash.java |
yields this:
Code: |
mqhash.java:92: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable
env.put(MQConstants.CHANNEL_PROPERTY, "your channel name");
^
mqhash.java:93: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable
env.put(MQConstants.HOST_NAME_PROPERTY, "your host name");
^
mqhash.java:94: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable
env.put(MQConstants.PORT_PROPERTY, new Integer(1414)); |
... will just have to do!  _________________ Here's an idea - don't destroy semaphores unless you're certain of what you're doing! -- Vitor |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Feb 20, 2009 4:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The MQ API calls have changed in v7 to support various things. In particular, the Constants have moved out of MQC into things more "native" like CMQC, CMQCFC, and etc.
The warnings you are seeing about unchecked calls, however, have nothing at all to do with the MQ API. They are entirely a consequence of compiling code written for Java 1.4 under a Java that is at least 1.5. Java 1.5 and later has a .. ... for forcing you to be explicit about things that it was previously lax on.
If you were to open your MQ Explorer v7 in an Eclipse Workbench, rather than as a Standalone Application, you automagically get a full MQ Java development environment that will give you handy warnings about this kind of thing, a handy local reference to the new Java MQ APIs, and lots of other features for doing these things in a bright and friendly way.
 |
|
Back to top |
|
 |
friedl.otto |
Posted: Fri Feb 20, 2009 4:13 am Post subject: |
|
|
Centurion
Joined: 06 Jul 2007 Posts: 116
|
mqjeff wrote: |
The MQ API calls have changed in v7 to support various things. In particular, the Constants have moved out of MQC into things more "native" like CMQC, CMQCFC, and etc. |
Would have been nice if BigBloo were a tad more verbose
about this little issue as a consideration for upgrading.
mqjeff wrote: |
The warnings you are seeing about unchecked calls, however, have nothing at all to do with the MQ API. They are entirely a consequence of compiling code written for Java 1.4 under a Java that is at least 1.5. Java 1.5 and later has a .. ... for forcing you to be explicit about things that it was previously lax on. |
Yep ... generics ... I've never been keen on them!  _________________ Here's an idea - don't destroy semaphores unless you're certain of what you're doing! -- Vitor |
|
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
|
|
|
|