Skip to content

Commit

Permalink
Merge pull request #97 from scionaltera/rabbitmq
Browse files Browse the repository at this point in the history
Switch to RabbitMQ
  • Loading branch information
scionaltera authored Apr 25, 2023
2 parents cd0a75c + 4486ce8 commit d2d9b8b
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 24 deletions.
2 changes: 1 addition & 1 deletion agonyforge-mud-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'com.agonyforge'
version = '0.0.9'
version = '0.0.10-SNAPSHOT'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Configuration
@ConfigurationProperties(prefix = "mud.broker")
public class ActiveMqBrokerProperties {
public class MqBrokerProperties {
private Boolean ssl;
private String host;
private Integer port;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketBrokerConfiguration extends AbstractSessionWebSocketMessageBrokerConfigurer<Session> {
private final ActiveMqBrokerProperties brokerProperties;
private final MqBrokerProperties brokerProperties;

@Autowired
public WebSocketBrokerConfiguration(ActiveMqBrokerProperties brokerProperties) {
public WebSocketBrokerConfiguration(MqBrokerProperties brokerProperties) {
this.brokerProperties = brokerProperties;
}

Expand Down
2 changes: 1 addition & 1 deletion agonyforge-mud-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = 'com.agonyforge'
version = '0.0.9'
version = '0.0.10-SNAPSHOT'

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion agonyforge-mud-models-dynamodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group 'com.agonyforge'
version '0.0.9'
version '0.0.10-SNAPSHOT'

repositories {
mavenCentral()
Expand Down
49 changes: 37 additions & 12 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,43 @@ services:
done
'
activemq:
image: symptoma/activemq:5.17.1-envvars
# This is the highest version of RabbitMQ that is supported by AWS's "Amazon MQ"
# product as of writing this. Any message broker capable of supporting the STOMP
# protocol should be able to work. I am targeting Agony Forge at being deployed
# in AWS, so I'm trying to keep things like this as close as possible to what you'd
# see there.
rabbitmq:
image: rabbitmq:3.10-management
ports:
- "127.0.0.1:5672:5672"
- "127.0.0.1:15672:15672"
- "127.0.0.1:61613:61613"
- "127.0.0.1:8161:8161"
environment:
ACTIVEMQ_WEBCONSOLE_USE_DEFAULT_ADDRESS: "false"

# user with access to web UI
ACTIVEMQ_WEBADMIN_USERNAME: admin
ACTIVEMQ_WEBADMIN_PASSWORD: admin
volumes:
- './src/main/resources/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins'

# user with access to broker
ACTIVEMQ_USERNAME: mud
ACTIVEMQ_PASSWORD: mud
# If you'd rather use ActiveMQ here's a sample configuration for it.
# This is the highest version supported by AWS's "Amazon MQ" version of ActiveMQ as
# of writing this.
#
# I stopped using it and switched to RabbitMQ because this version is getting pretty
# old. Apache released an update to ActiveMQ called Artemis and Spring Boot's starter
# library for activemq stopped getting updated in favor of their artemis one. Since I
# can't use newer versions on AWS and I can't use the old Spring Boot library in the
# latest Spring Boot, it made sense to swap over to RabbitMQ which seems to be getting
# more current support over there.
#
# activemq:
# image: symptoma/activemq:5.17.1-envvars
# ports:
# - "127.0.0.1:61613:61613"
# - "127.0.0.1:8161:8161"
# environment:
# ACTIVEMQ_WEBCONSOLE_USE_DEFAULT_ADDRESS: "false"
#
# # user with access to web UI
# ACTIVEMQ_WEBADMIN_USERNAME: admin
# ACTIVEMQ_WEBADMIN_PASSWORD: admin
#
# # user with access to broker
# ACTIVEMQ_USERNAME: mud
# ACTIVEMQ_PASSWORD: mud
12 changes: 6 additions & 6 deletions mud.EXAMPLE.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ MUD_DYNAMO_TABLE_NAME=agonyforge
MUD_DYNAMO_GSI1_NAME=gsi1
MUD_DYNAMO_GSI2_NAME=gsi2

# The following tell the MUD where to find ActiveMQ's STOMP connector, and the credentials to use to
# The following tell the MUD where to find the broker's STOMP connector, and the credentials to use to
# log into it both as the "System" user and a regular user.
MUD_BROKER_SSL=false
MUD_BROKER_HOST=activemq
MUD_BROKER_HOST=rabbitmq
MUD_BROKER_PORT=61613
MUD_BROKER_SYSTEM_USERNAME=admin
MUD_BROKER_SYSTEM_PASSWORD=admin
MUD_BROKER_CLIENT_USERNAME=mud
MUD_BROKER_CLIENT_PASSWORD=mud
MUD_BROKER_SYSTEM_USERNAME=guest
MUD_BROKER_SYSTEM_PASSWORD=guest
MUD_BROKER_CLIENT_USERNAME=guest
MUD_BROKER_CLIENT_PASSWORD=guest

# You will need to go to https://developer.amazon.com and set up a security profile there. It will give you
# a client ID and secret that you can use to create an OAuth client in AWS Cognito. Then you will be able to
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/rabbitmq/enabled_plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[rabbitmq_management,rabbitmq_stomp].

0 comments on commit d2d9b8b

Please sign in to comment.