WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

In WebSphere V9.0,why doesn't the AdminJMS.createWMQActivationSpec command allow NULL parameters?

  • 1.  In WebSphere V9.0,why doesn't the AdminJMS.createWMQActivationSpec command allow NULL parameters?

    Posted 11/23/20 04:24 PM

    To fix a problem with MQ connection issue, we were advised to add the following custom properties

    to the MQ Activation Specification:

    clientID

    subscriptionName

    providerVersionWhen I tried to execute the below command, the custom properties were not added to the activation spec:

    -------------

    AdminJMS.createWMQActivationSpec("Node=xxxNode,Server=xxxServer","xxxQueue" ,"jms/xxxQueue",'javax.jms.Queue', [["qmgrName", "xxxQM"], ["qmgrHostname", "xxxHost"], ["qmgrPortNumber", "1414"], ["wmqTransportType", "CLIENT"], ["maxPoolSize","2"], ["failureDeliveryCount", "3"], ["stopEndpointIfDeliveryFails", "false"], ["msgRetention", "YES"], ["clientId", " "], ["subscriptionName", " "],["providerVersion", " "]])

    AdminConfig.save()

    -----------------

    Is the above syntax correct? How can I add the above parameters with NULL values to the activation spec?



    #Support
    #SupportMigration
    #WebSphereApplicationServer(WAS)


  • 2.  RE: In WebSphere V9.0,why doesn't the AdminJMS.createWMQActivationSpec command allow NULL parameters?
    Best Answer

    Posted 11/23/20 04:28 PM

    Unfortunately, AdminJMS.createWMQActivationSpec() doesn't permit NULL or empty-string values. The solution to this is to create with the non-NULL parameters and add the NULL parameters via the AdminTask.modifyWMQActivationSpec() method. Please try:

    ActSpec = AdminJMS.createWMQActivationSpec("Node=xxxNode,Server=xxxServer","xxxQueue" ,"jms/xxxQueue",'javax.jms.Queue', [["qmgrName", "xxxQM"], ["qmgrHostname", "xxxHost"], ["qmgrPortNumber", "1414"], ["wmqTransportType", "CLIENT"], ["maxPoolSize","2"], ["failureDeliveryCount", "3"], ["stopEndpointIfDeliveryFails", "false"], ["msgRetention", "YES"]])

    AdminTask.modifyWMQActivationSpec(ActSpec, '[-clientId -providerVersion -subscriptionName]')

    AdminConfig.save()

    That should create properties with null value.



    #Support
    #SupportMigration
    #WebSphereApplicationServer(WAS)