Hi Geoff
Sorry to bother you again.

I have a question about blueprinting and using brooklyn.parameters

I managed to write a long winded application with a couple of services
which are like a cluster, but written out fully.    That works fine.

Now  I'm trying to abstract out the entity to put in the catalog and
template three variables which need to differ between one instance of the
entity and another.

I could be misusing the syntax, but the error message I'm getting is so
vague, I don't know where to look for my problem:   Here's the definition
of the entity.  As you can see, I need the templated name to occur in a
bunch of spots

*first... in the deployment, I'm hoping to do something like this*

services:
  - type:  htclienttemplate
    clientname: ht1
    jmxport: 19001
    resturl: "
http://127.0.0.1:8081/v1/applications/infocommons/entities/ht1/sensors";
- type:  htclienttemplate
    clientname: ht2
    jmxport: 19001
    resturl: "
http://127.0.0.1:8081/v1/applications/infocommons/entities/ht2/sensors";

*And this is what I'm trying to add to the catalog.  *

brooklyn.catalog:
  id: htclienttemplate
  version: "1.1"
  itemType: entity
  item:
    name: $brooklyn:config("clientname")
    location: localhost
    type: org.apache.brooklyn.entity.java.VanillaJavaApp
    brooklyn.config:
      run.dir: /Users/peterabramowitsch/manhattan
      children.startable.mode: FOREGROUND
      skip.install: true
      vanillaJavaApp.mainClass: org.ucsf.clients.RunUcsfNlp
      vanillaJavaApp.args:
        - -cid
        - $brooklyn:config("clientname")
        - -rid
        - run1
        - -longnotes
        - false
        - -c
        - org.ucsf.clients.ht.DataCommonsClient
      vanillaJavaApp.classpath:
        -
/Users/peterabramowitsch/manhattan/lib/ht_client-0.1.0-jar-with-dependencies.jar
        -
/Users/peterabramowitsch/manhattan/lib/ucsfNlp-0.1.0-jar-with-dependencies.jar
      vanillaJavaApp.jvmDefines:
        mongo.dbname: xxxxxxx
        mongo.username: xxxxxxx
        mongo.userpwd: xxxxxxxx
        serveraddr: mongodb://localhost:27017
        log4j.configurationFile: config/log4j-datacommons.xml
        log4jid: $brooklyn:config("clientname")
        brooklyn.credentials: xxxxxxxxxxx
        brooklyn.resturl: $brooklyn:config("resturl")
        jmx.direct.port: $brooklyn:config("jmxport")
    brooklyn.parameters:
    - name: clientname
    - name: jmxport
    - name: resturl


I can't interpret the error I'm getting.......

ERROR
 Bundle BasicManagedBundle{symbolicName=htclienttemplate, version=1.1.0,
url=null} failed installation: Error installing catalog items: Failed to
install htclienttemplate:1.1.0, types
[BasicRegisteredType[htclienttemplate:1.1;null]] gave errors; 5 errors
including: Transformer for Brooklyn OASIS CAMP interpreter gave an error
creating this plan: java.lang.ClassCastException

On Wed, Mar 13, 2019 at 1:03 PM Geoff Macartney <[email protected]>
wrote:

> Hey Peter,
>
> Ah cool, so you are actually posting *to* Brooklyn from the app itself? If
> you have the flexibility to do that, that's great. Glad it's working out.
>
> Do let us know any thoughts you have about your experience with Brooklyn,
> usability, usefulness etc. All feedback is welcome!
>
> Best,
> Geoff
>
>
>
>
> On Tue, 12 Mar 2019 at 23:36 Peter Abramowitsch <[email protected]>
> wrote:
>
> > Thanks Geoff,
> > About ten minutes after I posted,I  realized I could just use the
> Brooklyn
> > REST API.  I just needed to launch the java app with a system property
> > containing the composed URLbase and credentials to post back with.   It
> > works great and is much easier than JMX.
> >
> > On Mon, Mar 11, 2019, 2:56 PM Geoff Macartney <[email protected]
> >
> > wrote:
> >
> > > Hi Peter
> > >
> > > I'd say an MBean is a reasonable way to expose that sort of thing to
> > > Brooklyn (or any management/orchestration tool) for a Java app.  I
> guess
> > > there would be other ways of doing it without JMX but they might be
> more
> > > ad-hoc, while this is just the sort of thing JMX is for.
> > >
> > > Since you're already thinking about using (extending) VanillaJavaApp in
> > > Brooklyn to manage your app,  you could look into adding sensors for
> > > whatever MBeans you want to expose from your app using JmxFeed. There
> is
> > > some documentation for this at [1]. You could also use the code for
> > > TomcatServerImpl [2] as a reference, as it uses JmxFeeds.
> > >
> > > Just my 2ยข. It's not something I've done myself I'm afraid, so I don't
> > have
> > > any better example I can point you to.
> > >
> > > Geoff
> > >
> > > [1]
> > >
> https://brooklyn.apache.org/v/latest/blueprints/java/feeds.html#jmx-feed
> > > [2]
> > >
> > >
> >
> https://github.com/apache/brooklyn-library/blob/master/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServerImpl.java
> > >
> > >
> > > On Mon, 11 Mar 2019 at 00:21 Peter Abramowitsch <
> [email protected]
> > >
> > > wrote:
> > >
> > > > I'm interested in adding some custom sensing in my app.  Using the
> > > > VanillaJavaApp Entity,  let's say I would like my application whose
> > main
> > > > class is set in the blueprint to send back a dynamic "records
> processed
> > > > count" and have it appear in amongst the other sensors on Brooklyn's
> > web
> > > > UI.
> > > >
> > > > My Java app is not a webserver,  just a long-running process.  Is the
> > > > correct approach to create an MBean as part of my app and connect it
> > back
> > > > to Brooklyn's server?   I'm not sure how to put all the pieces
> > > together...
> > > > or if there's a better way.  Can it be done without extending
> Brooklyn
> > > > itself?
> > > >
> > > > Peter
> > > >
> > >
> >
>

Reply via email to