Skip to content

Commit

Permalink
Make rabbitmq actually optional
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Oct 11, 2023
1 parent be9f1f4 commit 18ab575
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
9 changes: 0 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ volumes:
o: bind
device: $PWD/datadir

secrets:
slapd_password:
file: ./datadir/secrets/slapd_password.txt
geoserver_privileged_user_passwd:
file: ./datadir/secrets/geoserver_privileged_user_passwd.txt

services:
database:
image: georchestra/database:latest
Expand All @@ -28,9 +22,6 @@ services:

ldap:
image: georchestra/ldap:latest
secrets:
- slapd_password
- geoserver_privileged_user_passwd
environment:
- SLAPD_ORGANISATION=georchestra
- SLAPD_DOMAIN=georchestra.org
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
package org.georchestra.gateway.events;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.listener.MessageListenerContainer;
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.gateway.config.GatewayAutoConfiguration;
import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;

@Profile("!test && !it")
@Configuration(proxyBeanMethods = false)
@AutoConfiguration
@AutoConfigureAfter(GatewayAutoConfiguration.class)
@ImportResource({ "classpath:rabbit-listener-context.xml", "classpath:rabbit-sender-context.xml" })
@ConditionalOnExpression("${georchestra.gateway.security.enableRabbitmqEvents:true}")
@ConditionalOnProperty(name = "georchestra.gateway.security.enableRabbitmqEvents", havingValue = "true", matchIfMissing = false)
public class RabbitmqEventsAutoConfiguration {

@Bean
@DependsOn({ "eventTemplate" })
public RabbitmqEventsSender eventsSender(AmqpTemplate eventTemplate) {
RabbitmqEventsSender eventsSender(AmqpTemplate eventTemplate) {
return new RabbitmqEventsSender(eventTemplate);
}

Expand Down

0 comments on commit 18ab575

Please sign in to comment.