Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove producers default and DL queue+excahnge #166

Merged
merged 1 commit into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,13 @@ public class GateKeeperStreamsConfig {
private static final Set<RunState> RUN_STATES_TO_WEBLOG =
Set.of(RunState.QUEUED, RunState.CANCELED);

@Value("${gatekeeper.producer.topology.queueName}")
private String producerDefaultQueueName;

@Value("${gatekeeper.producer.topology.topicExchangeName}")
@Value("${gatekeeper.producer.topicExchange}")
private String producerTopicExchangeName;

@Value("${gatekeeper.consumer.topology.topicExchangeName}")
@Value("${gatekeeper.consumer.topicExchange}")
private String consumerTopicExchangeName;

@Value("${gatekeeper.consumer.topology.queueName}")
@Value("${gatekeeper.consumer.queue}")
private String consumerQueueName;

private final RabbitEndpointService rabbit;
Expand Down Expand Up @@ -110,8 +107,7 @@ private Disposable createGatekeeperProducer() {
})
.onErrorContinue(handleError());

return createTransProducerStream(
rabbit, producerTopicExchangeName, producerDefaultQueueName, ROUTING_KEY)
return createTransProducerStream(rabbit, producerTopicExchangeName)
.send(processedFlux)
.onErrorContinue(handleError())
.subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
@Configuration
@RequiredArgsConstructor
public class WesConsumerConfig {
@Value("${wes.consumer.topology.queueName}")
@Value("${wes.consumer.queue}")
private String queueName;

@Value("${wes.consumer.topology.topicExchangeName}")
@Value("${wes.consumer.topicExchange}")
private String topicExchangeName;

@Value("${wes.consumer.topology.topicRoutingKeys}")
@Value("${wes.consumer.topicRoutingKeys}")
private String[] topicRoutingKeys;

private final WebLogEventSender webLogEventSender;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,13 @@
public class RabbitmqUtils {

public static TransactionalProducerStream<WfMgmtRunMsg> createTransProducerStream(
RabbitEndpointService rabbit, String topicName, String queueName, String... routingKey) {
val dlxName = topicName + "-dlx";
val dlqName = queueName + "-dlq";
RabbitEndpointService rabbit, String topicName) {
return rabbit
.declareTopology(
topologyBuilder ->
topologyBuilder
.declareExchange(dlxName)
.and()
.declareQueue(dlqName)
.boundTo(dlxName)
.and()
.declareExchange(topicName)
.type(ExchangeType.topic)
.and()
.declareQueue(queueName)
.boundTo(topicName, routingKey)
.withDeadLetterExchange(dlxName))
.type(ExchangeType.topic))
.createTransactionalProducerStream(WfMgmtRunMsg.class)
.route()
.toExchange(topicName)
Expand All @@ -58,7 +47,7 @@ public static TransactionalProducerStream<WfMgmtRunMsg> createTransProducerStrea

public static TransactionalConsumerStream<WfMgmtRunMsg> createTransConsumerStream(
RabbitEndpointService rabbit, String topicName, String queueName, String... routingKey) {
val dlxName = topicName + "-dlx";
val dlxName = queueName + "-dlx";
val dlqName = queueName + "-dlq";
return rabbit
.declareTopology(
Expand Down
19 changes: 9 additions & 10 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,20 @@ rabbit:
username: user
password: pass

wes.consumer.topology:
queueName: "execute-queue"
topicExchangeName: "mgmt-in"
topicRoutingKeys: "INITIALIZING, CANCELING" # comma separated Array of keys
wes.consumer:
queue: "execute-queue"
topicExchange: "gatekeeper-out"
topicRoutingKeys: "INITIALIZING, CANCELING" # comma separated Array of keys

---
spring.profiles: gatekeeper

gatekeeper.consumer.topology:
queueName: "gatekeeper-in-queue"
topicExchangeName: "mgmt-in"
gatekeeper.consumer:
queue: "gatekeeper-in-queue"
topicExchange: "gatekeeper-in"

gatekeeper.producer.topology:
queueName: "gatekeeper-out-default"
topicExchangeName: "gatekeeper-out"
gatekeeper.producer:
topicExchange: "gatekeeper-out"

spring.cloud.stream:
function.definition: weblogConsumer
Expand Down