This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
java/works/weave/socks/shipping/configuration Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 7
7
import org .springframework .amqp .rabbit .core .RabbitTemplate ;
8
8
import org .springframework .amqp .support .converter .Jackson2JsonMessageConverter ;
9
9
import org .springframework .amqp .support .converter .MessageConverter ;
10
+ import org .springframework .beans .factory .annotation .Value ;
10
11
import org .springframework .context .annotation .Bean ;
11
12
import org .springframework .context .annotation .Configuration ;
12
13
14
+
13
15
@ Configuration
14
16
public class RabbitMqConfiguration {
17
+
15
18
final static String queueName = "shipping-task" ;
16
19
20
+ @ Value ("${spring.rabbitmq.host}" )
21
+ private String host ;
22
+
17
23
@ Bean
18
24
public ConnectionFactory connectionFactory () {
19
- CachingConnectionFactory connectionFactory = new CachingConnectionFactory ("rabbitmq" );
25
+ CachingConnectionFactory connectionFactory = new CachingConnectionFactory (host );
20
26
connectionFactory .setCloseTimeout (5000 );
21
27
connectionFactory .setConnectionTimeout (5000 );
22
28
connectionFactory .setUsername ("guest" );
Original file line number Diff line number Diff line change 1
1
server.port =${port:8080}
2
+ spring.rabbitmq.host =rabbitmq
2
3
endpoints.health.enabled =false
3
4
spring.zipkin.baseUrl =http://${zipkin:zipkin}:9411/
4
5
spring.sleuth.sampler.percentage =1.0
You can’t perform that action at this time.
0 commit comments