Hi Peter,

First of all thanks for the observations on VanillaJavaApp. I’ll raise a 
Brooklyn JIRA issue about that. More on that in a moment.

Secondly, your catalog looks broadly good, but there are a couple of 
observations I’d make.

The main one is that you can’t have "name: $brooklyn:config("clientname”)” in 
the definition of the entity in the catalog - after all this is defining the 
_catalog_  entity but the clientname only gets defined at the time you deploy 
an app.

I was able to get a catalog entry defined with the following catalog definition 
(using a simple “no-op” Java app):

brooklyn.catalog:
  id: htclienttemplate
  version: "1.1"
  itemType: entity
  item:
    name: htclientexample
    type: org.apache.brooklyn.entity.java.VanillaJavaApp

    brooklyn.config:
      run.dir: /Users/geoff
      children.startable.mode: FOREGROUND
      skip.install: true
      vanillaJavaApp.mainClass: com.example.VerySimpleApp
      vanillaJavaApp.args:
        - -cid
        - $brooklyn:config("clientname")
        - -rid
        - run1
        - -longnotes
        - false
        - -c
        - org.ucsf.clients.ht.DataCommonsClient
      vanillaJavaApp.classpath:
        - 
/Users/geoff/workspaces/github.com/apache/brooklyn/vjatest/target/vjatest-1.0.0-SNAPSHOT.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


The other thing is that you will still run into the problem with the single 
pid.txt file - which will mean that you’ll need to do some workaround. You 
could do it in your app, but a simpler workaround would be to define “run.dir” 
separately for each entity:


name: testapp
location: localhost
services:
  - id: h1
    type: htclienttemplate
    name: app1
    brooklyn.config:
      run.dir: /users/geoff/a
      jmx.enabled: false
      clientname: client1
  - id: h2
    type: htclienttemplate
    name: app2
    brooklyn.config:
      run.dir: /users/geoff/b
      jmx.enabled: false
      clientname: client2


Hopefully we can soon get around to fixing VanillaJavaApp so that this is 
unnecessary.

Hope this is of some use,

Regards
Geoff





Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to