users@glassfish.java.net

Re: How to create JMS resource with asadmin

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Jun 2009 15:15:41 PDT

> When creating a ConnectionFactory JMS Resource
> through the admin console, there is a checkbox to
> Require Connection Validation. But the
> create-jsm-resource subcommand doesn't accept the
> isconnectvalidatereq=true attribute. How can I
> specify that Connection Validation is Required?

This checkbox corresponds to the "is-connection-validation-required" of the connector connection pool.
the "create-jms-resource" command creates both a connector-resource and connector-connection-pool, and this attribute need to be set at the pool, not the resource, after the creation.

To do this, you can use the set command.
Here is what you can do:


% asadmin create-jms-resource --restype javax.jms.QueueConnectionFactory XYZ
Command create-jms-resource executed successfully.

% asadmin list-connector-connection-pools
XYZ

% asadmin get server.resources.connector-connection-pool.XYZ.*
server.resources.connector-connection-pool.XYZ.associate-with-thread = false
server.resources.connector-connection-pool.XYZ.connection-creation-retry-attempts = 0
server.resources.connector-connection-pool.XYZ.connection-creation-retry-interval-in-seconds = 10
server.resources.connector-connection-pool.XYZ.connection-definition-name = javax.jms.QueueConnectionFactory
server.resources.connector-connection-pool.XYZ.connection-leak-reclaim = false
server.resources.connector-connection-pool.XYZ.connection-leak-timeout-in-seconds = 0
server.resources.connector-connection-pool.XYZ.description =
server.resources.connector-connection-pool.XYZ.fail-all-connections = false
server.resources.connector-connection-pool.XYZ.idle-timeout-in-seconds = 300
server.resources.connector-connection-pool.XYZ.is-connection-validation-required = false
server.resources.connector-connection-pool.XYZ.lazy-connection-association = false
server.resources.connector-connection-pool.XYZ.lazy-connection-enlistment = false
server.resources.connector-connection-pool.XYZ.match-connections = true
server.resources.connector-connection-pool.XYZ.max-connection-usage-count = 0
server.resources.connector-connection-pool.XYZ.max-pool-size = 250
server.resources.connector-connection-pool.XYZ.max-wait-time-in-millis = 60000
server.resources.connector-connection-pool.XYZ.name = XYZ
server.resources.connector-connection-pool.XYZ.pool-resize-quantity = 2
server.resources.connector-connection-pool.XYZ.resource-adapter-name = jmsra
server.resources.connector-connection-pool.XYZ.steady-pool-size = 1
server.resources.connector-connection-pool.XYZ.transaction-support =
server.resources.connector-connection-pool.XYZ.validate-atmost-once-period-in-seconds = 0


% asadmin set server.resources.connector-connection-pool.XYZ.is-connection-validation-required=true
server.resources.connector-connection-pool.XYZ.is-connection-validation-required = true


That should do it. hope this help.

Anissa.
[Message sent by forum member 'anilam' (anilam)]

http://forums.java.net/jive/thread.jspa?messageID=352814