Products Downloads


French version


Execution of the VaToolBxAMQPPublish, VaToolBxAMQPSyncPublish, VaToolBxAMQPCreateExchange et VaToolBxAMQPCreateQueue functions makes use of a YAML format configuration file defining 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' 'VaToolBxAMQCreateExchange' '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.


When JVM (Java Virtual Machine) starts up this file is defined by the com.hardis.adelia.mom.configuration environment variable

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


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 YML 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

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.





  • Aucune étiquette