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 » Value for wildcardFormat property on TopicConnectionFactory

Post new topic  Reply to topic
 Value for wildcardFormat property on TopicConnectionFactory « View previous topic :: View next topic » 
Author Message
igor.beslic
PostPosted: Fri Aug 27, 2010 2:48 am    Post subject: Value for wildcardFormat property on TopicConnectionFactory Reply with quote

Novice

Joined: 15 Oct 2009
Posts: 14
Location: Zagreb, Croatia

Hi,

do anybody know what is right value for wildcardFormat parameter on MQ JCA adapter topic connection factory. I use v7 wmq.jmsra.rar deployed to JBoss AS 5.1.0. and I'm trying to subscribe to tpics defined with expression: PRICES/ZSE/*. From Information Center at http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.amqzao.doc/fm14400_.htm I found that VALUE for version of wildcard syntax is to be used should be CHAR_ONLY. Unfortunetly AppSrv container cannot initalize TopicConnection Factory with that value.

Topic connection factory JNDI setup:
Code:

<tx-connection-factory>
      <!-- Bind this ConnectionFactory with the JNDI name wmq/RBAEBroker -->
      <jndi-name>wmqTCF</jndi-name>

      <!-- Indicate that the connection factory supports XA transactions -->
      <xa-transaction />

      <!-- rar-name is the actual RAR file name, in this case wmq.jmsra.rar -->
      <rar-name>wmq.jmsra.rar</rar-name>

      <!-- connection-definition is the ConnectionFactory interface
        defined in the ra.xml -->
      <connection-definition>javax.jms.TopicConnectionFactory</connection-definition>

      <!--
         Configuration for the ConnectionFactory. This defines the channel, hostname, port,
         queueManager, and transportType properties for a client (TCP/IP) connection to WMQ
      -->
      <config-property name="channel" type="java.lang.String">SYSTEM.DEF.SVRCONN</config-property>
      <config-property name="hostName" type="java.lang.String">MQHOST</config-property>
      <config-property name="port" type="java.lang.String">1414</config-property>
      <config-property name="queueManager" type="java.lang.String">QM_IGOR</config-property>
      <config-property name="transportType" type="java.lang.String">CLIENT</config-property>
      <config-property name="username" type="java.lang.String">igorb</config-property>
      <config-property name="messageRetention" type="java.lang.Boolean">true</config-property>
      <config-property name="providerVersion" type="java.lang.String">7</config-property>
      <config-property name="wildcardFormat" type="java.lang.String">CHAR_ONLY</config-property>

      <!-- define security domain -->
      <security-domain-and-application>JmsXARealm</security-domain-and-application>
    </tx-connection-factory>



Code used to read from topic:

Code:

@Resource(mappedName="java:/wmqTCF")
private TopicConnectionFactory wmqTCF;

...
...
final String pricesTopicStr = "PRICES/ZSE/*";
TopicConnection tc = wmqTCF.createTopicConnection();
         tc.start();
TopicSession ts = tc.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
Topic feedTopic = ts.createTopic(transTopicStr);
TopicSubscriber subscriber = ts.createSubscriber(feedTopic);
Message msg = subscriber.receive();


Call to
Code:
wmqTCF.createTopicConnection()
causes exception:
Code:
com.ibm.mq.connector.DetailedInvalidPropertyException: MQJCA3001: Value 'CHAR_ONLY' for the property 'wildcardFormat' is not valid, error code: MQJCA3001 A property of an ActivationSpec or ManagedConnectionFactory object has a value that is not valid. Supply a valid value for the property.
   at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:135)
   at com.ibm.mq.connector.AbstractConfiguration.validate(AbstractConfiguration.java:1847)

Please help...
Back to top
View user's profile Send private message Visit poster's website
igor.beslic
PostPosted: Fri Aug 27, 2010 3:22 am    Post subject: Reply with quote

Novice

Joined: 15 Oct 2009
Posts: 14
Location: Zagreb, Croatia

Hi,
I've decompiled ConnectionFactory, the property is an integer so changing cf con to:
Code:
<config-property name="wildcardFormat" type="java.lang.Integer">0</config-property>
makes failing line of code to pass.

Now, my code stucks at:
Code:
Message msg = subscriber.receive();

and waits forever. It is wierd because in MQ Explorer I made test subscription to same topic and I see messages.

Also in MQ Explorer Subscriptions overview I see both subscriptions, one test and one from jboss.

In addition I have slightly complicated MQ API application that also connects to same topic and perfectly reads contents of same wildcarded topic.
Back to top
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Fri Aug 27, 2010 4:13 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to be using TOPIC_ONLY not CHAR_ONLY, as you need to be using Broker version 2, I'm pretty sure.

http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/jm10910_.htm

Also I believe your link does not go where you think it does, or I'm confused about how MQRC 2278 relates to WILDCARDFORMAT.

And you could have looked at http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.javadoc.doc/WMQJMSClasses/constant-values.html
to see that MQJMS_WILDCARD_CHAR_ONLY and MQJMS_WILDCARD_TOPIC_ONLY are ints, and didn't need to decompile anything.

ETA: also, the most likely reason that your receive() is hanging is that you haven't started the connection.
Back to top
View user's profile Send private message
igor.beslic
PostPosted: Mon Aug 30, 2010 2:35 am    Post subject: Reply with quote

Novice

Joined: 15 Oct 2009
Posts: 14
Location: Zagreb, Croatia

mqjeff,
you were right regarding constants but while observing subscriptions in MQ Explorer I was surprised to see that jboss subscription no matter what wildcardFormat parameter is, always connects with wildcard usage "Topic level wildcard".

I double checked jboss log, and there is trace that connector reads value from resource adapter descriptor correctly and sets value corectly. But when subscription is made, wildcardFormat is configured as Topic level wildcard.

I'll try to figure how to set it programaticly.
Back to top
View user's profile Send private message Visit poster's website
igor.beslic
PostPosted: Mon Aug 30, 2010 4:23 am    Post subject: Reply with quote

Novice

Joined: 15 Oct 2009
Posts: 14
Location: Zagreb, Croatia

At the end, I've changed topic string to "PRICES/ZSE/+" and now I'm receiving messages.

Regarding playing with JCA parameters to topicConnectionFactory I have final conclusion:

setting wildcardFormat and brokerVersion parameters at MQ JCA adapter descriptor for topicConnectionFactory does not influence on wildcard usage - what ever I've put there my code listed in first post always use Topic level wildcard.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Value for wildcardFormat property on TopicConnectionFactory
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.