Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-5873

Can't set static-connectors on AMQ bridge, if discovery-group were set before

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0.Final
    • 10.0.0.CR4
    • JMS
    • None

      When AMQ bridge is created with static-connectors field set, and then static-connectors are undefined and discovery-group is set (in a single batch), following error is thrown:

      "WFLYMSGAMQ0069: Attribute (static-connectors) can not been undefined as the resource does not define any alternative to this attribute."

      Problem seems to be missing STATIC_CONNECTORS.setAlternatives(CommonAttributes.DISCOVERY_GROUP) in resource definition, which is causing !attr.hasAlternative(resource.getModel()) check to fail in following code:

      AlternativeAttributeCheckHandler.java
          private void checkAlternativeAttribute(OperationContext context, String attributeName, boolean alternativeMustBeSet) throws OperationFailedException {
              if (attributeDefinitions.containsKey(attributeName)) {
                  AttributeDefinition attr = attributeDefinitions.get(attributeName);
                  final Resource resource = context.readResource(EMPTY_ADDRESS);
                  if (alternativeMustBeSet) {
                      if (!attr.hasAlternative(resource.getModel())) {
                          throw new OperationFailedException(MessagingLogger.ROOT_LOGGER.undefineAttributeWithoutAlternative(attributeName));
                      }
                  } else {
                      if (attr.hasAlternative(resource.getModel())) {
                          throw new OperationFailedException(MessagingLogger.ROOT_LOGGER.altAttributeAlreadyDefined(attributeName));
                      }
                  }
              }
          }
      

              thofman Tomas Hofman
              thofman Tomas Hofman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: