PubSub+ Connector Manager Example

PubSub+ Connector Manager is distributed with a few examples (sample configurations and shell scripts), allowing you to start and run the Connector Manager together with different Self-Managed Connectors with minimum effort.

This section provides step-by-step instructions on how to run the Connector for IBM MQ example that is provided in the zip archive in the Connector Manager's package. You can use this section as a model to apply similar instructions for any Self-Managed Connector (after downloading the configuration and executable files for these Self-Managed Connectors).

For detailed information about the samples folder and examples, see Starting the Connector Manager.

Starting the Connector Manager

The shell script to start the Connector Manager allows you to initiate a Connector Manager instance and pre-configure it with essential parameters. For detailed information, see Starting the Connector Manager with a Shell Script.

Encrypting Values for Cloud Configurations

To create encrypted values for cloud configuration files, you must start the Connector Manager in local mode (completely isolated from any production environment with the keystore file that is generated for this purpose) with enabled encryption, or as a localhost. For detailed information, see Encrypting Values for Cloud Configurations.

Starting PubSub+ Self-Managed Connectors

In addition to the Connector Manager configurations, the samples/connectors folder contains a few configuration examples to start Self-Managed Connector instances (with the script to do that). Therefore, all commands that you need are in the samples/connectors folder.

Currently, the examples of configuration parameters for Self-Managed Connectors are available for:

  • IBM MQ

  • TIBCO EMS

The samples/connectors folder contains a few nested subdirectories:

  • applications — contains all JAR files with Self-Managed Connectors (not included). You must have the JAR files of the Self-Managed Connectors copied into this folder.

  • libs — contains some third-party libraries that are required for any Self-Managed Connector to run. If necessary, you must fill these out before starting your Self-Managed Connector(s).

  • connectors-configs — contains operator configurations that are required to start up the Self-Managed Connector.

  • security — contains a pre-generated keystore called demo.jks. This must not be used for any purpose other than demonstration.

In the samples/connectors folder, there is a connector.sh script that allows you to start up the Self-Managed Connector. This script is the same as the one distributed with any Self-Managed Connector, so all the required parameters are the same.

Prerequisites for PubSub+ Self-Managed Connector Startup

Before running your Self-Managed Connector with the Connector Manager, make sure that a few prerequisites are met.

Prerequisites for the PubSub+ Software Event Broker:

  • The software event broker must be running on port 55555 with default parameters.

  • A queue with the name Solace/Queue/0 must be created.

Prerequisites for the IBM MQ Broker:

  • The IBM MQ broker must be running with default parameters. Credentials are:

    • Username: admin

    • Password: passw0rd

    • Queue Manager: QM1

  • A queue with the name DEV.QUEUE.0 must be created.

Prerequisites for Configuration:

In the samples/connectors/connectors-configs/ibmmq folder in the application.yml file, the encrypt.keyStore.location variable must be modified to include the absolute path.

This is a full list of the parameters that you can use with shell script for Self-Managed Connectors:

Parameter Description
-n or --name

Specifies the name of the Self-Managed Connector instance that is set up in spring.application.name. This name has an impact on grouping Self-Managed Connectors only.

-l or --libs

Specifies the directory that contains the required and optional dependency JARs, such as Micrometer metrics export dependencies (if configured). If not specified, it uses the current ./libs/ folder.

-p or --profile

Specifies the profile to be used for Self-Managed Connector configuration. The application-<profile>.ymlconfiguration file is used. The default value is empty, which means that the Self-Managed Connector will look for a configuration file called application.yml.

-c or --config

Specifies the path to the folder that contains the configuration files to be applied during Self-Managed Connector startup for the chosen profile. By default, it is set to the current folder and automatically looks in nested and sibling config folders (if any), as well as in the current and parent folders.

-P or --port

Specifies the port that the Self-Managed Connector will be running on. The default value is 8090.

-H or --host

Specifies the host that the Self-Managed Connector will be running on. The default value is 127.0.0.1.

-mp or --mgmt_port

Specifies the management port for the back calls of the current Self-Managed Connector from the Connector Manager. The default value is 9009. Ignored if the -cm argument is missing.

-j or --jar

Specifies the path to the specified JAR file to start the Self-Managed Connector. If not specified, the default JAR file from the current folder is used.

-cm or --manager

Allows cloud configuration for the Self-Managed Connector by using the Connector Manager's configuration storage.

-cmp or --cm_port

Specifies the port that the Connector Manager is running on. The default value is 9500. Ignored if the -cm argument is missing.

-cmh or --cm_host

Specifies the host that the Connector Manager is running on. The default value is 127.0.0.1. Ignored if the -cm argument is missing.

-o or --options

Specifies the JVM options that are used when starting the Connector Manager (for example, -Xms64M -Xmx1G). Use single/double quotes to specify parameters.

-b or --background

Runs the Connector Manager in the background. No logs are displayed, and the Connector Manager continues to run in detached mode.

-s or --show

Prints the start CLI command in raw format and exits.

-h or --help

Prints this help page and exits.

Starting the Connector for IBM MQ with Default Configuration

The connector.sh script has a few additional properties, allowing you to configure your Self-Managed Connector with various parameters dynamically:

$> ./connector.sh \
    -c ./connectors-configs/ibmmq \
    -j ./applications/pubsubplus-connector-ibmmq-1.2.1.jar \
    -cm \
    -cmh 10.0.0.100 \
    -cmp 9500 \
    -H 10.0.0.100 \
    --port 9101 \
    -mp 9201

This command starts the Connector for IBM MQ with one workflow enabled. The Connector for IBM MQ is shown in the Connector Manager:

  • running on host 10.0.0.100 and port 9500 (parameters -cm, -cmh, and cmp) .

  • specifying the back management port and host as 9201 (to make calls from the Connector Manager to the Connector for IBM MQ) (parameter -mp).

  • specifying the Connector for IBM MQ host and port as 9101 (parameters -H and -cp).

For more information, see the (parameter -h) help.