brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] brooklyn-docs pull request #159: Add docs for enricher.producer values
Date Thu, 30 Mar 2017 09:05:34 GMT
Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-docs/pull/159#discussion_r108874111
  
    --- Diff: guide/java/policies.md ---
    @@ -235,6 +235,30 @@ An Enricher which computes latency in accessing a URL.
     Can be used to combine the values of sensors.  This enricher should be instantiated using
Enrichers.buider.combining(..).
     This enricher is only available in Java blueprints and cannot be used in YAML.
     
    +#### Note On Enricher Producers
    +
    +`enricher.producer: brooklyn:entity("entity.id.here")` is a `brooklyn.config` key/value
pair that should be supplied to any
    +enricher that has an `enricher.sourceSensor` value that comes from an entity that is
different from the entity on which the
    +enricher is defined.
    +
    +For example, if we consider the Transfomer from above, suppose that `enricher.sourceSensor:
$brooklyn:sensor("urls.tcp.list")`
    +is actually a sensor on a different entity called `load.balancer`. In this case, we would
need to supploy an
    +`enricher.producer` value.
    +
    +{% highlight yaml %}
    +brooklyn.enrichers:
    +- type: org.apache.brooklyn.enricher.stock.Transformer
    +  brooklyn.config:
    +    enricher.producer: brooklyn:entity("load.balancer")
    +    enricher.sourceSensor: $brooklyn:sensor("urls.tcp.string")
    +    enricher.targetSensor: $brooklyn:sensor("urls.tcp.withBrackets")
    +    enricher.targetValue: $brooklyn:formatString("[%s]", $brooklyn:attributeWhenReady("urls.tcp.string"))
    +{% endhighlight %}
    +
    +It is important to note that the value supplied to `enricher.producer` must be immediately
resolvable. While it would be valid
    +DSL syntax to write `enricher.producer: brooklyn:entity($brooklyn:attributeWhenReady("load.balancer.entity"))`
(assuming the
    --- End diff --
    
    Use {% highlight yaml %} for this for cleaner presentation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message