0

I have a Apama project that connects to Kafka Broker, using custom plugin. When we start the Apama project I pass in the config values like broker url, using the .evt (event). I use engine_deploy that create the deployable structure of the project and when start the correlator I use the –config flag to run with the deployed version of code.

I want to create Docker image of Apama project so that I can pass values like Kafka Broker URL as argument into my Docker image, and want that to be picked up by the .evt (event) file when the Docker image starts using the same deployed structure. Please let me know what is the best way to achieve the Parameterization of Apama Docker image.

Kind regards,

Adnan

Adnan Mian
  • 415
  • 1
  • 5
  • 17

1 Answers1

1

I have a feeling you may be mixing concepts, but there are ways to make both work.

With modern custom Apama applications like you describe, it would probably be more normal to either use OS Environment Variables (and read them from EPL with the management plugin)[1], or correlator properties YAML files and command-line substitution with -Dkey=value (and read them from EPL with a different method of the management plugin)[2]. These are recent(ish) additions in the past several years. Of course, you could choose to keep your existing evt config code, then simply add an extra monitor to read one of the other mechanisms and send events internally with the info to be picked up by your existing listeners.

We’ve also done a blog post[3] in the past showing how to pass “secrets” to Docker and to Kubernetes, and the same techniques would apply for configs (secrets are kind of a special config).

Links:

  1. Read env vars: ApamaDoc for the Management plugin to read the “/info” categories: https://documentation.softwareag.com/onlinehelp/Rohan/Apama/v10-3-1/apama10-3-1/ApamaDoc/com/apama/correlator/Component.html#getInfo()

The REST API shows that the path of interest is “envp”: https://documentation.softwareag.com/onlinehelp/Rohan/Apama/v10-3-1/apama10-3-1/rest/correlator.html#infoEnvpGet

  1. Read correlator properties (command line substitution, and the files, and ApamaDoc ref):

https://documentation.softwareag.com/onlinehelp/Rohan/Apama/v10-3-1/apama10-3-1/apama-webhelp/#page/apama-webhelp%2Fre-DepAndManApaApp_starting_the_correlator.html%23

https://documentation.softwareag.com/onlinehelp/Rohan/Apama/v10-3-1/apama10-3-1/apama-webhelp/#page/apama-webhelp%2Fco-DepAndManApaApp_using_properties_files.html%23wwconnect_header

https://documentation.softwareag.com/onlinehelp/Rohan/Apama/v10-3-1/apama10-3-1/ApamaDoc/com/apama/correlator/Component.html#getConfigProperties()

  1. Docker/K8S secrets and configs blog post: http://www.apamacommunity.com/passing-secrets-to-the-correlator-with-docker-and-kubernetes/ There is also a sample for this distributed in the product at samples/docker/applications (the secrets sample)

Kev