...
ENV | Description |
---|---|
| The domain name used for the PIPEFORCE instance. For example |
| The cluster internal host name of the hub service in order to connect to. |
| The cluster internal host port in order to connect to. |
| The cluster internal url of the hub service in order to connect via REST for example. |
| The default dead letter queue used for RabbitMQ messaging. It is usually |
| The default messaging exchange used for RabbitMQ messaging. It is usually |
| The default messaging topic used for RabbitMQ messaging. It is usually the same as the default exchange. |
| The messaging host to connect to in order to register a RabbitMQ listener. See below in documentation how to optionally pass messaging username and password as a secret if required. They aren’t provided by default. |
| The messaging host to connect to in order to register a RabbitMQ listener. |
| The namespace of the instance this services runs inside. |
| The external url to the PIPEFORCE webui portal in order to refer to from inside a microservice. |
| The name of this custom service inside PIPEFORCE. |
| The staging mode, this namespace is running in. Usually one of |
Note: Since any value of these ENV variables could change over time, you should never persist them in your microservice!
Custom ENV variables
Additionally to these default environment variables, you can also add your custom ones by using the parameter env
on the command service.start
:
...
Note: Since this default value is part of your source code, it should only be used in case it is not used in production. For example for demo logins or similar.
Shared secret ENV variables
In case you would like to share a single secret across multiple services, you must prefix it with SHARED_
instead. Secrets prefixed with SHARED_
can be passed to any microservice without security check.
Lets assume you have created a secret with name SHARED_MY_SECRET
, then you can pass it to any service like this example shows:
Code Block | ||
---|---|---|
| ||
pipeline:
- service.start:
name: myservice
image: myimage
env:
MY_SECRET_ENV: $uri:secret:SHARED_MY_SECRET |
Note |
---|
Important |
Monitoring a microservice
...
PIPEFORCE_MESSAGING_HOST
= The cluster-internal hostname of the messaging service.PIPEFORCE_MESSAGING_PORT
= The cluster-internal port of the messaging service.
Info |
---|
Note: This The values of these values ENVs can change at any time, so do not use store them as fixed value. |
Additionally to these variables, you need to set the PIPEFORCE_MESSAGING_USERNAME
and PIPEFORCE_MESSAGING_PASSWORD
along with your service.start
command using the custom uri prefix $uri:secret
. Here is how to do it:
Create a new secret in your secret store with name
pipeforce-<yourservice>_messaging-_username
and typesecret-text
and set the RabbitMQ username you would like to use to connect.Create a new secret in your secret store with name
pipeforce-<yourservice>_messaging-_password
and typesecret-text
and set the RabbitMQ password you would like to use to connect.
...
Code Block |
---|
pipeline: - service.start: name: "myservice" image: "some/image" env: PIPEFORCE_MESSAGING_USERNAME: "$uri:secret:pipeforce-myservice_messaging-username" PIPEFORCE_MESSAGING_PASSWORD: "$uri:secret:pipeforce-myservice_messaging-password" |
This way, the sensitive values will be passed to your container without the requirement to store them into code or refer from external systems.
...
By default any microservice is responsible to setup and manage its own queues.
Each queue should contain always equal message types. So, for different messages, create additional queues.
...
Code Block |
---|
service_shoppingcart_orders_q |
Default Topic
PIEPFORCE PIPEFORCE automatically creates a default topic exchange on startup with this name: pipeforce.hub.default.topic
.
PIPEFORCE core services are configured in a way that any event which happens there or which is sent using the event.send
command is will also be send to this default topic.
In case a microservice wants to listen to a certain type of message with a given routing key, it needs to create a binding between the topic pipeforce.hub.default.topic
and the queue you want to “feed” this message into.
Note: The name of this default topic could change. Therefore, do not hard-code it into your microservice. Instead, use the value from the passed-in ENV variable PIPEFORCE_MESSAGING_DEFAULT_TOPIC
.
See here for more details about topics, routings and queues: https://www.rabbitmq.com/tutorials/tutorial-five-python.html
...
Additionally, a default Dead Letter Queue is automatically configured by PIPEFORCE those name is given by the ENV variable PIPEFORCE
: pipeforce_hubMESSAGING_defaultDEFAULT_dlqDLQ
.
Any other queue can be configured in a way to forward messages to this queue if one these rules apply:
...
Code Block |
---|
x-dead-letter-exchange = ""
x-dead-letter-routing-key = "pipeforce_hub_default_dlq" |
How to set these arguments in your microservice depends on your selected programming language and the RabbitMQ client implementation you're using. See documentation for details: https://www.rabbitmq.com/dlx.html
...