Skip to main content

Consuming the SayHelloService according to the environment via Provisioning

If you used the tesb:start-demo-all command to start all the Talend Infrastructure services, the Provisioning Service is already started.

If not, go back to the container and start it as follows:

  1. tesb:start-provision-server
  2. tesb:start-provision-agent

Consume the SayHelloService in a development environment.

  1. Create a profile with the feature, resource and placeholder needed for the development environment.

    tprovision:profile-create dev_env dev
  2. Add the feature you previously published in the Artifact Repository:

    tprovision:feature-create dev_env mvn:org.example/SayHelloConsumer-feature/0.1.0-SNAPSHOT/xml SayHelloConsumer-feature 0.1.0-SNAPSHOT
  3. Add the resource that will contain the context used by the SayHelloConsumer:

    tprovision:resource-create dev_env etc/SayHelloConsumer.cfg
  4. Add the placeholder providing the dev context to apply to the SayHelloConsumer:

    tprovision:placeholder-create dev environment dev
  5. Release the placeholder:

    tprovision:placeholders-release dev 1.0
  6. Release the profile:

    tprovision:profile-release dev_env 1.0 dev 1.0
  7. Now that the new dev_env profile has been released, you can apply it to the container on which you deployed the SayHelloService, it will automatically deploy the SayHelloConsumer feature in the Talend Runtime Container with the corresponding context (the environment placeholder will be dynamically replaced by its value: dev, which corresponds to the karaf credentials defined in the Job context variables) allowing it to consume the service.

    To apply the dev_env profile, use the following command:

    tprovision-agent:apply-profiles dev_env 1.0

Consume the SayHelloService in a production environment.

  1. Create a profile with the feature, resource and placeholder needed for the production environment:
    tprovision:profile-create prod_env prod
  2. Add the feature you previously published in the Artifact Repository:
    tprovision:feature-create prod_env mvn:org.example/SayHelloConsumer-feature/0.1.0/xml SayHelloConsumer-feature 0.1.0
  3. Add the resource that will contain the context used by the SayHelloConsumer:
    tprovision:resource-create prod_env etc/SayHelloConsumer.cfg
  4. Add the placeholder providing the prod context to apply to the SayHelloConsumer:
    tprovision:placeholder-create prod environment prod
  5. Release the placeholder:
    tprovision:placeholders-release prod 1.0
  6. Release the profile:
    tprovision:profile-release prod_env 1.0 prod 1.0
  7. Now that the new prod_env profile has been released, you can apply it to the container on which you deployed the SayHelloService, it will automatically deploy the SayHelloConsumer feature in the Talend Runtime Container with the corresponding context (the environment placeholder will be dynamically replaced by its value: prod, which corresponds to the tadmin credentials defined in the Job context variables) allowing it to consume the service.

    To apply the prod_env profile, use the following command:
    tprovision-agent:apply-profiles prod_env 1.0

The creation of profiles described above, performed directly in the Talend Runtime Container can be performed as well from the Provisioning page of the Talend Administration Center. For more information, see Creating a profile.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!