This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql_insert = text("insert into user values(2,'Maria','email@email.com','Ma')") | |
engine.execute(sql_insert) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bindingkey da dlx e consumer | |
channel.queueBind(DLX_QUEUE,DLX_NAME,DLX_BINDING_KEY+".#"); | |
channel.queueBind(CONSUMER_QUEUE,EXCHANGE_NAME,CONSUMER_BINDING_KEY+".#"); | |
connection.close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<String, Object> map = new HashMap<String,Object>(); | |
map.put("x-message-ttl",10000); | |
map.put("x-dead-letter-exchange",DLX_NAME); | |
map.put("x-dead-letter-routing-key",DLX_BINDING_KEY); | |
channel.queueDeclare(CONSUMER_QUEUE,false,false,false,map); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//declarar as exchanges (main e dlx) | |
channel.exchangeDeclare(DLX_NAME,"topic"); | |
channel.exchangeDeclare(EXCHANGE_NAME,"topic"); | |
//declarar as filas: consumer, dlx | |
channel.queueDeclare(DLX_QUEUE,false,false,false,null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConnectionFactory factory = new ConnectionFactory(); | |
factory.setHost("172.24.0.2"); | |
factory.setUsername("admin"); | |
factory.setPassword("pass123"); | |
factory.setPort(5672); | |
Connection connection = factory.newConnection(); | |
Channel channel = connection.createChannel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package DLX; | |
import com.rabbitmq.client.AMQP; | |
import com.rabbitmq.client.Channel; | |
import com.rabbitmq.client.Connection; | |
import com.rabbitmq.client.ConnectionFactory; | |
import java.io.IOException; | |
import java.util.HashMap; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RabbitMQ properties | |
services: | |
rabbitmq: | |
image: rabbitmq:3-management | |
container_name: rabbitmq_management | |
ports: | |
- 25672:25672 # (erlang) communication between the nodes and CLI tool | |
- 15672:15672 # communication with the web management API | |