Messaging Configuration#
The Janssen server provides messaging infrastructure for publish-subscribe message flows. Messaging infrastructure is configurable to the level where it can be enabled or disabled. When enabled, the configuration also allows a choice of providers and supplying configuration for those providers.
The Janssen Server provides multiple configuration tools to perform these tasks.
Use the command line to perform actions from the terminal. Learn how to use Jans CLI here or jump straight to the Using Command Line
Use a fully functional text-based user interface from the terminal. Learn how to use Jans Text-based UI (TUI) here or jump straight to the configuration steps
Use REST API for programmatic access or invoke via tools like CURL or Postman. Learn how to use Janssen Server Config API here or Jump straight to the configuration steps
Using Command Line#
To get the details of Janssen command line operations relevant to
the messaging configuration, you can check the operations under
MessageConfiguration
using the command below:
/opt/jans/jans-cli/config-cli.py --info MessageConfiguration
Output | |
---|---|
1 2 3 4 5 6 7 |
|
Get Messaging Configuration#
You can get the Messaging Configuration of the Janssen Server by performing this operation.
/opt/jans/jans-cli/config-cli.py --operation-id get-config-message
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Patch Messaging Configuration#
To patch update the messaging configuration, use
the patch-config-message
operation.
The patch-config-message
operation uses the
JSON Patch schema to describe
the configuration change. Refer
here
to know more about schema.
For instance, to perform a replace
operation and change the
messageProviderType
from DISABLED
to REDIS
,
the JSON Patch data would be like below:
Input | |
---|---|
1 2 3 4 5 6 7 |
|
Store the above JSON Patch data in a file, for instance,
/tmp/message-patch.json
Using the above file, perform the operation as below:
/opt/jans/jans-cli/config-cli.py --operation-id patch-config-message \
--data /tmp/message-patch.json
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Messaging Configuration For Postgres#
When Postgres
is being used as a messaging provider,
use the operations under the task
MessageConfigurationPostgres
to configure and manage the provider.
/opt/jans/jans-cli/config-cli.py --info MessageConfigurationPostgres
Output | |
---|---|
1 2 3 4 5 6 7 8 |
|
Get Postgres Messaging Configuration#
You can get the Postgres messaging configuration of the Janssen Server by performing this operation.
/opt/jans/jans-cli/config-cli.py --operation-id get-config-message-postgres
It will show the configuration details as below.
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 |
|
Update Postgres Messaging Configuration#
To update the configuration follow the steps below.
- Get the current Postgres messaging configuration
and store it in a file for editing using the command below.
/opt/jans/jans-cli/config-cli.py -no-color --operation-id get-config-message-postgres >\ /tmp/postgres.json
- Edit and update the desired configuration values in the file while
keeping other properties and values unchanged.Updates must adhere
to the
PostgresMessageConfiguration
schema as mentioned here. The schema details can be retrieved using the command below. The schema defines what values and datatypes are acceptable for each property value.text title="Command" /opt/jans/jans-cli/config-cli.py --schema PostgresMessageConfiguration
-
The Janssen Server also provides an example of data that adheres to the above schema. To fetch the example, use the command below.
Command/opt/jans/jans-cli/config-cli.py --schema-sample PostgresMessageConfiguration
-
Use the updated file to send the update to the Janssen Server using the command below
Command/opt/jans/jans-cli/config-cli.py --operation-id put-config-message-postgres \ --data /tmp/postgres.json
Patch Postgres Message Configuration#
To update the messaging configuration use the
patch-config-message-postgres
operation.
The patch-config-message-postgres
operation uses the
JSON Patch schema to describe
the configuration change. Refer
here
to know more about schema.
For instance, to perform a replace
operation at
messageWaitMillis
and change it from 100
to 1000
,
the JSON Patch data would look like below:
Input | |
---|---|
1 2 3 4 5 6 7 |
|
Store the above JSON Patch data in a file, for instance,
/tmp/patch-postgres.json
Using the above file, perform the operation as below:
/opt/jans/jans-cli/config-cli.py --operation-id patch-config-message-postgres \
--data /tmp/patch-postgres.json
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 |
|
Messaging Configuration For Redis#
To manage the Redis messaging configuratio, check the operations under
the task MessageConfigurationRedis
using the command below:
/opt/jans/jans-cli/config-cli.py --info MessageConfigurationRedis
Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 |
|
Get Redis Messaging Configuration#
You can get the Redis message configuration of your Janssen Server by performing this operation.
/opt/jans/jans-cli/config-cli.py --operation-id get-config-message-redis
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
Update Redis Message Configuration#
To update the configuration follow the steps below.
- Get the current Redis Message configuration
and store it into a file for editing
/opt/jans/jans-cli/config-cli.py -no-color --operation-id get-config-message-redis >\ /tmp/redis.json
- Edit and update the desired configuration values in the file while keeping
other properties and values unchanged. Updates must adhere to
the
RedisMessageConfiguration
schema as mentioned here. The schema details can be retrieved using the command below. The schema defines what values and datatypes are acceptable for each property value.text title="Command" /opt/jans/jans-cli/config-cli.py --schema RedisMessageConfiguration
-
The Janssen Server also provides an example of data that adheres to the above schema.To fetch the example, use the command below.
Command/opt/jans/jans-cli/config-cli.py --schema-sample RedisMessageConfiguration
-
Use the updated file to send the update to the Janssen Server using the command below
Command/opt/jans/jans-cli/config-cli.py --operation-id put-config-message-redis \ --data /tmp/redis.json
Patch Redis Message Configuration#
You may need to update the messaging configuration, In that case
patch-config-message-redis
can be used to modify the configuration.
The patch-config-message-redis
operation uses the
JSON Patch schema to describe
the configuration change. Refer
here
to know more about schema.
For instance, to perform a replace
operation at
maxTotalConnections
and change it from 500
to 600
,
the JSON Patch data would look like below:
Input | |
---|---|
1 2 3 4 5 6 7 |
|
Store the above JSON Patch data in a file, for instance,
/tmp/patch-redis.json
Using the above file, perform the operation as below:
/opt/jans/jans-cli/config-cli.py --operation-id patch-config-message-redis \
--data /tmp/patch-redis.json
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
Using Text-based UI#
In the Janssen Server, You can manage Message Configuration using the Text-Based UI also.
You can start TUI using the command below:
sudo /opt/jans/jans-cli/jans_cli_tui.py
Navigate to Auth Server
-> Messages
to open the Message screen as shown
in the image below. There are three different message configuration options
accessible on this screen. You can update the details of these messages.
Using Configuration REST API#
Janssen Server Configuration REST API exposes relevant endpoints for managing and configuring the Messages Configuration. Endpoint details are published in the Swagger document.
Created: 2022-07-26