Skip to content

How to set a reference attribute to None #1483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbeniteza opened this issue Aug 2, 2023 · 3 comments
Closed

How to set a reference attribute to None #1483

dbeniteza opened this issue Aug 2, 2023 · 3 comments
Labels
enhancement New feature or request WDT 4.0

Comments

@dbeniteza
Copy link

Let's suppose the following simple WDT model for a domain with the following JMS resources: 2 UniformDistributedQueue and 1 Quota. The first UniformDistributedQueue, test_queue-u0, has configured as ErrorDestination the second UniformDistributedQueue (error_queue-u0) and as Quota the quota-u0 resource.

resources:
  JMSSystemResource:
    test_jms_module:
      JmsResource:
        UniformDistributedQueue:
          test_queue-u0:
            JNDIName: test_queue/udq/u0
            LoadBalancingPolicy: Random
            LocalJNDIName: test_queue-udq-u0
            Quota: quota-u0
            DeliveryFailureParams:
              ErrorDestination: error_queue-u0
              ExpirationLoggingPolicy: "%header%,%properties%,JMSDeliveryTime,JMSRedeliveryLimit"
              ExpirationPolicy: Log
              RedeliveryLimit: 10
          error_queue-u0:
            JNDIName: error_queue/udq/u0
            LoadBalancingPolicy: Random
            LocalJNDIName: error_queue-udq-u0
        Quota:
          quota-u0:
            BytesMaximum: 5000
            MessagesMaximum: 50
      Target: my_cluster-c01

Now I want to update the test_queue-u0 resource: unset the ErrorDestination and Quota values. These MBeans are references to other resources. I can achieve this update through the console by simply set to None the reference (see screenshots below):
Captura de pantalla 2023-08-02 092105

Captura de pantalla 2023-08-02 092115

How can this update be done through a WDT model? I've tried setting ErrorDestination and Quota attributes for test_queue-u0 resource to blank, None, null or empty string (''), but unfortunately none of these tries worked because WDT expects a reference to an existing resource and it looks for for None, null or empty string ('') resource which doesn't exist. See some of these errors:

  1. Set ErrorDestination empty: ErrorDestination:
SEVERE Messages:

        1. WLSDPLY-09015: updateDomain deployment failed: Unable to locate destination {} in JMS System Resource null
  1. Set ErrorDestination to None: ErrorDestination: None
SEVERE Messages:

        1. WLSDPLY-09015: updateDomain deployment failed: Unable to locate destination None in JMS System Resource null

  1. Set ErrorDestination to empty string: ErrorDestination: ''
SEVERE Messages:

        1. WLSDPLY-09015: updateDomain deployment failed: Unable to locate destination  in JMS System Resource null
  1. Set ErrorDestination to null: ErrorDestination: null
SEVERE Messages:

        1. WLSDPLY-09015: updateDomain deployment failed: Unable to locate destination {} in JMS System Resource null

The only way I could do this update is by removing the entire attributes ErrorDestination and Quota, so they don't appear in the WDT model.

I was expect to do this update in a similar way as the Administration console, by setting to None the appropiate MBean in WDT or leave it empty.

@robertpatrick
Copy link
Member

robertpatrick commented Aug 2, 2023

@dbeniteza Yes, this is not something we directly support today. We will treat this as a request for enhancement in a future version of WDT.

For now, you need to delete the enclosing object and recreate it by passing a model to updateDomain that looks something like this:

resources:
  JMSSystemResource:
    test_jms_module:
      JmsResource:
        UniformDistributedQueue:
          # Delete the existing queue
          '!test_queue-u0':
          # Recreate it with these values 
          test_queue-u0:
            JNDIName: test_queue/udq/u0
            LoadBalancingPolicy: Random
            LocalJNDIName: test_queue-udq-u0
            DeliveryFailureParams:
              ExpirationLoggingPolicy: "%header%,%properties%,JMSDeliveryTime,JMSRedeliveryLimit"
              ExpirationPolicy: Log
              RedeliveryLimit: 10
          error_queue-u0:
            JNDIName: error_queue/udq/u0
            LoadBalancingPolicy: Random
            LocalJNDIName: error_queue-udq-u0
        Quota:
          quota-u0:
            BytesMaximum: 5000
            MessagesMaximum: 50
      Target: my_cluster-c01

@robertpatrick robertpatrick added the enhancement New feature or request label Aug 2, 2023
@robertpatrick
Copy link
Member

Fix for this issue merged into the develop-4.0 branch. WDT 4.0 is on track for release next month.

@robertpatrick
Copy link
Member

WDT 4.0.0 released so closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WDT 4.0
Projects
None yet
Development

No branches or pull requests

2 participants