[ACCEPTED]-Understanding MQ Series bindings files-ibm-mq
Before addressing the .bindings file, we 75 need to step back a bit and look at JNDI 74 - the Java Naming and Directory Interface 73 - and how it is used by JMS. The Queue, Topic 72 and various types of Connection Factory 71 are all run-time JMS objects with methods 70 and attributes. But you can pre-define 69 them and store them in a registry where 68 the JMS application can retrieve them using 67 JNDI lookups.
This is helpful because the 66 objects are like coins in that they have 65 a JMS side and a provider-specific side. On 64 the JMS side, any administered object looks 63 about the same. Regardless of the underlying 62 transport provider, a ConnectionFactory 61 has the same methods and attributes. However, on 60 the provider-specific side, the administered 59 objects look very different from one transport 58 provider to the next. For example, the 57 ConnectionFactory used with a WebSphere 56 MQ transport will have an attribute for 55 the Queue Manager. No other transport provider 54 has a "queue manager" so this 53 attribute is only valid in a WMQ context.
The 52 two aspects of administered objects are 51 the "glue" that allows JMS to 50 work independently of transport provider. In 49 your code you just have to look up a ConnectionFactory 48 and you get an object suitable to perform 47 method calls against. Under the covers, the 46 provider's JMS classes use the provider-specific 45 object attributes to supply context to convert 44 the generic JMS API calls into provider-specific 43 calls. Thus the connection object that you 42 instantiate results in a WMQ CONNECT call 41 which specifies a QMgr name, host, port, channel 40 and a variety of other parameters.
OK, I 39 promised to get to the .bindings file. I 38 said previously that the JNDI lookup was 37 against "a registry" and that 36 usually means LDAP or similar. But Sun 35 engineered JNDI like JMS in that there is 34 an API that your program uses and an SPI 33 or Service Provider Interface that is used 32 by the registry. So, although JNDI can be 31 implemented in LDAP, there is nothing that 30 says it must be implemented in LDAP. One of 29 the base implementations that Sun provided 28 right out of the box was to use the local 27 filesystem as the registry. In this implementation, the 26 root context is a file folder. Each context 25 can store either another sub-context (another 24 file folder) or object definitions. Typically 23 there is one folder for the root context 22 and all of the objects are defined at that 21 level. The file that holds the object definitions 20 is...you guessed it... the .bindings file.
The 19 objects in the .bindings file are represented 18 in Name/Type/Value triplets. So each .bindings 17 file typically has many objects. Each object 16 has many attributes. Each attribute has 15 a name, a value and the type of variable 14 that holds the value. The best way to get 13 a handle on the .bindings file is to sort 12 it which will put all the objects and their 11 attributes together and make it more human-readable. For 10 a list of possible properties, see the manual.
Of course, the 9 .bindings file is supposed to be a compiled 8 artifact and not intended to be human readable. IBM 7 provides the JMSAdmin tool to generate and 6 read the .bindings file. You can also use 5 WMQ Explorer to manage the administered 4 objects in a .bindings file. These are 3 also discussed in the manual linked above. There 2 is also a (some say) good tutorial in developerWorks 1 here.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.