Products Downloads


French version


 

Execution of the VaToolBxAMQPPublish, VaToolBxAMQPSyncPublish, VaToolBxAMQPCreateExchange et VaToolBxAMQPCreateQueue functions makes use of a configuration file (in YAML format in Windows or Java environments, or in XML format in AS/400 environmentsdefining the configuration of each Adelia logical broker manipulated in the L4G source by these functions. 


Example of L4G

CALL_DLL 'VaToolBx' 'VaToolBxAMQPPublish' 'myLogicalBroker'  'directExchange' 'routeOne' 'Hello world!' *BLANK myReturnCode


CALL_DLL 'VaToolBx' 'VaToolBxAMQPCreateExchange' 'myLogicalBroker' 'myNewExchange' 'topic' *FALSE *TRUE *FALSE *BLANK *BLANK myReturnCode 


In this example, myLogicalBroker corresponds to a logical broker the characteristics of which are defined in this configuration file.


With a Java runtime, this file is defined when the JVM (Java Virtual Machine) is started by the com.hardis.adelia.mom.configuration variable:

.. -Dcom.hardis.adelia.mom.configuration=C:\directory\AdeliaLogicalBrokersConfig.yaml



With a Windows runtime, this file is searched in the current directory and if necessary must be defined by the environment variable ADELIA_MOM_CONFIGURATION_FILE :

ADELIA_MOM_CONFIGURATION_FILE= C:\directory\AdeliaLogicalBrokersConfig.yaml


In an AS/400 environment, the BRKR4AS Data Area must be present in the execution context. This Data Area must contain the 128-character 'CHAR' parameter which specifies the location of the configuration file in the AS/400 IFS (for example: '/config/AdeliaLogicalBrokersConfig.xml').


Example of configuration to start Tomcat (by adapting catalina.bat):

Before:

%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% 


After:

%_EXECJAVA% %LOGGING_CONFIG% %LOGGING_MANAGER% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -D%ENDORSED_PROP%="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" -Dcom.hardis.adelia.mom.configuration ="D:\MyConfig\AdeliaLogicalBrokersConfig.yaml" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%


This file is read at the first execution of:

    • LOAD_DLL 'VaToolBx'
    • or CALL_DLL 'VaToolBxAMQPPublish'
    • or CALL_DLL ' VaToolBxAMQPSyncPublish'
    • or CALL_DLL ' VaToolBxAMQPCreateExchange'
    • or CALL_DLL ' VaToolBxAMQPCreateQueue'


Structure of the YAML document:


An example of a configuration file is supplied in the javarun\ AdeliaLogicalBrokersConfig.yaml sub-directory of the Adelia installation directory.

Prerequisites: this file's format is YAML. You must be familiar with this format in order to understand the content of the file. A YAML tutorial is available here: http://sweetohm.net/article/introduction-yaml.html.


Each higher level attribute describes the configuration of a user's Adelia logical broker. This attribute's value is the name of the logical broker given by the user.

In the example file, 'myLogicalAMQPBroker' defines an AMQP broker.


connectionFactoryConfig attribute:

Defines the broker connection configuration of messages supporting the AMQP v0.9.1 protocol. Our tests were validated with RabbitMQ open source message broker software (https://www.rabbitmq.com/).

For a connection to a remote message broker, you must as a minimum replace the default values with the username, password and host parameters.

Cf. https://www.rabbitmq.com/uri-spec.html, https://www.rabbitmq.com/api-guide.html#connecting.


channelPoolConfig attribute (supported by the Java runtime only)

Defines the configuration of the message broker connection pool. There are two types of connection: synchronous and asynchronous. The pool manages the two types using keys (key pool).

A connection is initiated at each VaToolBxAMQPXXX function call .

If there are many concurrent connections to the same logical broker, it may be useful to change the value of the maxTotalPerKey parameter.


entities attribute:

Defines the entities (exchanges, queues and queue/exchange and exchange/exchange links) to implement on the message broker.

These entities are created on the message broker at the first VaToolBxAMQPXXX function call (i.e. the first connection to the logical broker). These entities (in particular exchanges) can be used in the VaTollBxAMQPXXX functions.

Structure of the XML document (for AS/400):


An example of a configuration file (AdeliaLogicalBrokersConfig.xml) is supplied in the Adelia installation directory.



Each node located directly under the 'rootlogicalAMQPBrokers' root node describes the configuration of a user's Adelia logical broker. The "name" attribute's value is the name of the logical broker given by the user.


In the example file, 'myLogicalAMQPBroker' defines an AMQP broker.



The configuration of a logical broker is the same as the one described in the structure of a YAML document above.


↑ Top of page

  • Aucune étiquette