ZE - Consumer Deployment (Artemis)
Prerequisites
Install Java 17.
Ensure your Zephyr Enterprise and Artemis is set up and running, by launching the application in the browser:
Launch Zephyr with your respective host/domain. Example: https://test.yourzephyr.com/flex
Once Artemis is up and running, launch the management console with the IP and port. Example: http://localhost:6093/actuator/hawtio
Consumer Service Deployment (Jar)
Create a directory under folder opt
zephyrservice
.mkdir zephyrservice
Download the ze-consumer.jar and copy it under
zephyrservice
.Create a ze-consumer config file named
zeConsumer.properties
under folderzephyrservice
.vi zeConsumer.properties
Add the below line in the file
zeConsumer.properties
.#Consumer Service port server.port=8082 #Artemis Configuration artemis.queue.name=ze_queue artemis.queue.host.broker.ip=localhost artemis.queue.host.broker.port=61616 spring.artemis.mode=native # Activate Profile {dbType} = mysql/mssql/oracle, {queueType} = artemis/rabbitmq spring.profiles.active={dbType},{queueType} spring.autoconfigure.exclude= org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration, org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration # Audit service configurations audit.service.baseUrl=http://localhost:8083 # Zephyr service configurations zephyr.service.baseUrl=http://localhost:8080 # webhook service url zephyr.external.webhook.baseUrl=http://localhost:8081/webhook # Jira retry callback configurations # BackOffDelay allows dynamic calculation of the delay between retry attempts zephyr.jiracall.retry.backOffDelay=500 # multiplier allows dynamic calculation of the multiplier factor for exponential backoff zephyr.jiracall.retry.multiplier=2 # maxAttempts specifies the maximum number of retry attempts for the jira call. zephyr.jiracall.retry.maxAttempts=1
Append the below database-specific properties based on the Zephyr database you are using.
An example of zeConsumer.properties
for MySQL DB would look like the below:
#Consumer Service port server.port=8082 #Artemis Configuration artemis.queue.name=ze_queue artemis.queue.host.broker.ip=localhost artemis.queue.host.broker.port=61616 spring.artemis.mode=native # Activate Profile {dbType} = mysql/mssql/oracle, {queueType} = artemis/rabbitmq spring.profiles.active=mysql,artemis spring.autoconfigure.exclude= org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration, org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration # Audit service configurations audit.service.baseUrl=http://localhost:8083 # Zephyr service configurations zephyr.service.baseUrl=http://localhost:8080 # webhook service url zephyr.external.webhook.baseUrl=http://localhost:8081/webhook # Jira retry callback configurations # BackOffDelay allows dynamic calculation of the delay between retry attempts zephyr.jiracall.retry.backOffDelay=500 # multiplier allows dynamic calculation of the multiplier factor for exponential backoff zephyr.jiracall.retry.multiplier=2 # maxAttempts specifies the maximum number of retry attempts for the jira call. zephyr.jiracall.retry.maxAttempts=1 # Data source configurations applied for mysql --- --- spring.config.activate.on-profile=mysql spring.datasource.url=jdbc:mysql://localhost:3306/itcc?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.username=root spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.jpa.hibernate.ddl-auto=none spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
Open the “Terminal” or “Command Prompt”
Navigate to folder /opt/zephyrservice
Type the below command
Start the ze-consumer with the following command:
sudo nohup java -jar -Dspring.profiles.active=DB,queue_name -DzeConsumerConfigPath="<config file path till root folder>" ze-consumer.jar &
Example command:
sudo nohup java -jar -Dspring.profiles.active=mysql,artemis -DzeConsumerConfigPath="/opt/zephyrservice" ze-consumer.jar &
Note
The Logs folder will be created where your jars are deployed. Separate log files will be created for each jar. In the above example, it will be in /opt/zephyrservice.