oracle/weblogic-deploy-tooling

RFE: DestinationKeys MBean wrong reference as attribute in JMS

dbeniteza opened this issue · 5 comments

Hello,

The DestinationKeys MBean, which can be found within some JMS resources such as UniformDistributedQueue MBean and UniformDistributedTopic MBean, is not set properly in the WDT models. The name of the attribute/MBean is plural DestinationKeys. That makes sense, since the MBean type is an array of strings (class java.lang.String[]). However, WDT tool uses the name in singular, DestinationKey. This must be changed in order to have the same name as the MBean, in plural, DestinationKeys.

You can check the supported WDT attribute name with the modelHelp tool (DestinationKey as a list):

/admin/utils/weblogic-deploy/bin/modelHelp.sh -oracle_home /admin/fmw/fmw_12.2.1.4.0/ resources:/JMSSystemResource/JmsResource/UniformDistributedQueue
resources:
    JMSSystemResource:
        'JMS-1':
            JmsResource:
                UniformDistributedQueue:
                    'UniformDistributedQueue-1':
                        AttachSender:                   # string   (default=supports) +
                        ConsumptionPausedAtStartup:     # boolean  (default=false) +
                        DefaultTargetingEnabled:        # boolean  +
                        DefaultUnitOfOrder:             # boolean  (default=false) +
                        DestinationKey:                 # list     +

Using DestinationKeys results in an error in WDT because the attribute name is not allowed. See the error trace below:

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Jul 27, 2023 9:34:31 AM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling updateDomain version is 3.2.2:.562dcb0:Jul 21, 2023 15:28 UTC>
####<Jul 27, 2023 9:34:31 AM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The updateDomain program will write its log to directory /admin/utils/weblogic-deploy/logs>
####<Jul 27, 2023 9:34:32 AM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 12.2.1.4.0>
####<Jul 27, 2023 9:34:32 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /admin/utils/weblogic-deploy/lib/model_filters.json>
####<Jul 27, 2023 9:34:32 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type update found in filter configuration file /admin/utils/weblogic-deploy/lib/model_filters.json>
####<Jul 27, 2023 9:34:35 AM> <SEVERE> <Validator> <__process_model_node> <WLSDPLY-05029> <DestinationKeys is not one of the attribute names allowed in model location resources:/JMSSystemResource/test_isi-jeec-jmsm/JmsResource/UniformDistributedQueue/test_isi-jeec-jdq-u0. Valid names are ResetDeliveryCountOnForward, ConsumptionPausedAtStartup, LocalJNDIName, MessagingPerformancePreference, DefaultTargetingEnabled, SafExportPolicy, Quota, UnitOfOrderRouting, UnitOfWorkHandlingPolicy, JNDIName, SubDeploymentName, DefaultUnitOfOrder, ProductionPausedAtStartup, InsertionPausedAtStartup, IncompleteWorkExpirationTime, Notes, LoadBalancingPolicy, MaximumMessageSize, DestinationKey, ForwardDelay, AttachSender, JmsCreateDestinationIdentifier, Template>
####<Jul 27, 2023 9:34:35 AM> <SEVERE> <Validator> <__process_model_node> <WLSDPLY-05029> <DestinationKeys is not one of the attribute names allowed in model location resources:/JMSSystemResource/test_isi-jeec-jmsm/JmsResource/UniformDistributedTopic/test_isi-jeec-jdt-u0. Valid names are ConsumptionPausedAtStartup, LocalJNDIName, MessagingPerformancePreference, DefaultTargetingEnabled, SafExportPolicy, Quota, ForwardingPolicy, UnitOfOrderRouting, UnitOfWorkHandlingPolicy, JNDIName, SubDeploymentName, DefaultUnitOfOrder, ProductionPausedAtStartup, InsertionPausedAtStartup, IncompleteWorkExpirationTime, Notes, LoadBalancingPolicy, MaximumMessageSize, DestinationKey, AttachSender, JmsCreateDestinationIdentifier, Template>
####<Jul 27, 2023 9:34:35 AM> <SEVERE> <cla_helper> <validate_model> <WLSDPLY-20001> <updateDomain did not complete the operation because validation failed>
####<Jul 27, 2023 9:34:35 AM> <SEVERE> <update> <main> <WLSDPLY-09015> <updateDomain deployment failed: updateDomain did not complete the operation because validation failed>

Issue Log for updateDomain version 3.2.2 running WebLogic version 12.2.1.4.0 online mode:

SEVERE Messages:

        1. WLSDPLY-05029: DestinationKeys is not one of the attribute names allowed in model location resources:/JMSSystemResource/test_isi-jeec-jmsm/JmsResource/UniformDistributedQueue/test_isi-jeec-jdq-u0. Valid names are ResetDeliveryCountOnForward, ConsumptionPausedAtStartup, LocalJNDIName, MessagingPerformancePreference, DefaultTargetingEnabled, SafExportPolicy, Quota, UnitOfOrderRouting, UnitOfWorkHandlingPolicy, JNDIName, SubDeploymentName, DefaultUnitOfOrder, ProductionPausedAtStartup, InsertionPausedAtStartup, IncompleteWorkExpirationTime, Notes, LoadBalancingPolicy, MaximumMessageSize, DestinationKey, ForwardDelay, AttachSender, JmsCreateDestinationIdentifier, Template
        2. WLSDPLY-05029: DestinationKeys is not one of the attribute names allowed in model location resources:/JMSSystemResource/test_isi-jeec-jmsm/JmsResource/UniformDistributedTopic/test_isi-jeec-jdt-u0. Valid names are ConsumptionPausedAtStartup, LocalJNDIName, MessagingPerformancePreference, DefaultTargetingEnabled, SafExportPolicy, Quota, ForwardingPolicy, UnitOfOrderRouting, UnitOfWorkHandlingPolicy, JNDIName, SubDeploymentName, DefaultUnitOfOrder, ProductionPausedAtStartup, InsertionPausedAtStartup, IncompleteWorkExpirationTime, Notes, LoadBalancingPolicy, MaximumMessageSize, DestinationKey, AttachSender, JmsCreateDestinationIdentifier, Template
        3. WLSDPLY-20001: updateDomain did not complete the operation because validation failed
        4. WLSDPLY-09015: updateDomain deployment failed: updateDomain did not complete the operation because validation failed

Total:   SEVERE :    4  WARNING :    0

updateDomain.sh failed (exit code = 2)

Please correct all attribute names in WDT from DestinationKey to DestinationKeys. There should be multiple references in several JMS related MBeans.

@dbeniteza If you look at https://oracle.github.io/weblogic-deploy-tooling/concepts/model/#overview, the second paragraph clearly states that:

The model structure, and its folder and attribute names, are based on the WLST 12.2.1.3 offline structure

One difference with the WLST offline versus online naming is that attributes like DestinationKeys in online mode are called DestinationKey in offline mode. When we created WDT, we had to make a naming decision so we chose to use the offline names. The WDT knowledge base knows how to take the names from the model and convert them to their online names when running WDT operations in online mode. You can use the modelHelp tool to make sure that you are using the right names:

rpatrick@rpatrick-mac weblogic-deploy % bin/modelHelp.sh -oracle_home /opt/weblogic/wls12214 resources:/JMSSystemResource/JmsResource/UniformDistributedQueue
...
Attributes and sub-folders for resources:/JMSSystemResource/JmsResource/UniformDistributedQueue

resources:
    JMSSystemResource:
        'JMS-1':
            JmsResource:
                UniformDistributedQueue:
                    'UniformDistributedQueue-1':
                        AttachSender:                   # string   (default=supports) +
                        ConsumptionPausedAtStartup:     # boolean  (default=false) +
                        DefaultTargetingEnabled:        # boolean  +
                        DefaultUnitOfOrder:             # boolean  (default=false) +
                        DestinationKey:                 # list     +
                        ForwardDelay:                   # integer  (default=0) +
                        IncompleteWorkExpirationTime:   # integer  (default=0) +
                        InsertionPausedAtStartup:       # boolean  (default=false) +
                        JNDIName:                       # string   +
                        JmsCreateDestinationIdentifier: # string   +
                        LoadBalancingPolicy:            # string   +
                        LocalJNDIName:                  # string   +
                        MaximumMessageSize:             # integer  (default=0) +
                        MessagingPerformancePreference: # integer  (default=25) +
                        Notes:                          # string   +
                        ProductionPausedAtStartup:      # boolean  (default=false) +
                        Quota:                          # string   +
                        ResetDeliveryCountOnForward:    # boolean  (default=true) +
                        SafExportPolicy:                # string   (default=All) +
                        SubDeploymentName:              # string   +
                        Template:                       # string   +
                        UnitOfOrderRouting:             # string   +
                        UnitOfWorkHandlingPolicy:       # string   (default=PassThrough) +
...

So now that we have that clarified, are you having some specific issue with WDT other than being confused by the names?

For example, take a look at https://github.com/oracle/weblogic-deploy-tooling/blob/main/core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/JMSSystemResource.json#L938

The wlst_name field is set to DestinationKey${:s}. This somewhat cryptic notation means that when running in offline mode, replace the ${:s} token with nothing (everything before the colon) and when running in online mode, replace it with s (everything after the colon). This allows WDT to use the correct name based on the WLST mode.

Thanks for the quick response. Everything is clear now. Using 12.2.1.3 to be aligned with WDT must be way to work with it.

@dbeniteza

Using 12.2.1.3 to be aligned with WDT must be way to work with it.

No, using WLST offline names in the model is the way to work with it. WDT supports every WebLogic Server version from 10.3.6 to the upcoming 14.1.2 release.

The whole point of formally making the statement about 12.2.1.3 is for the rare cases where WebLogic/WLST changes the name of an attribute/folder--typically to correct a typo. For example, if in 12.2.1.3, the attribute was named MyAtribute and in a later version it was renamed to MyAttribute, the model name would stay MyAtribute but the WDT knowledge base would be updated to understand which name to use with which versions of WebLogic Server.

As I hope you can see, we have gone to great lengths to shield WDT models from the nuances of WLST across WebLogic Server versions and WLST offline/online modes. We didn't stop there, we also understand that there are bugs in some versions of WebLogic Server and where possible, WDT works around those bugs to provide the correct behavior. This is very different from writing your own WLST scripts where your scripts are directly exposed to all of these nuances.

We have an integration test called the alias-test that we run nightly against the WDT main branch that tests our knowledge base (internally known as aliases) against the folders/attributes, default values, etc. from WLST online and WLST offline across every version of WebLogic Server from 10.3.6 to the upcoming 14.1.2 release--including every quarterly PSU versions of 12.2.1.3, 12.2.1.4, and 14.1.1 released over the last 3 years. We do everything we can to make sure that what WDT supports is an accurate reflection of what is supported in WLST.