Aled Sage created BROOKLYN-281:
----------------------------------

             Summary: Enricher missing `brooklyn.config`: all config values 
ignored silently
                 Key: BROOKLYN-281
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-281
             Project: Brooklyn
          Issue Type: Bug
    Affects Versions: 0.9.0
            Reporter: Aled Sage


When attempting to use a {{Propagator}} enricher, we misconfigured the 
blueprint using YAML like that below (this is a much simplified example).

{noformat}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  id: app
  brooklyn.enrichers:
  - type: org.apache.brooklyn.enricher.stock.Propagator
    producer: $brooklyn:entity("my-machine")
    propagating:
    - $brooklyn:sensor("host.sshAddress")
  brooklyn.children:
  - type: org.apache.brooklyn.entity.machine.MachineEntity
    id: my-machine
{noformat}

Note the missing {{brooklyn.config}} inside the enricher. The blueprint should 
actually have been:

{noformat}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  id: app
  brooklyn.enrichers:
  - type: org.apache.brooklyn.enricher.stock.Propagator
    brooklyn.config:
      producer: $brooklyn:entity("my-machine")
      propagating:
      - $brooklyn:sensor("host.sshAddress")
  brooklyn.children:
  - type: org.apache.brooklyn.entity.machine.MachineEntity
    id: my-machine
{noformat}

The first blueprint ignored the config values for the propagator (without any 
helpful messages about it) and instead used the defaults. When combined with 
https://issues.apache.org/jira/browse/BROOKLYN-278, then the defaults resulted 
in a propagator being instantiated that caused an infinite loop!

I'd have much preferred a sensible error message about the map values inside 
the propagator not being supported, and suggesting that perhaps 
{{brooklyn.config}} should be used.

However, it's worth noting that with entities you can get away with missing out 
the {{brooklyn.config}}. In that case, it treats all the map entries as though 
they were inside a brooklyn.config. This allows for more concise blueprints, 
but probably risks confusing blueprint authors who can't tell if it's the same 
and who assume they can do the same in other situations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to