software.amazon.awssdk
athena
diff --git a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
index 0f2246aae6..d109d3307c 100644
--- a/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
+++ b/compatibility-tests/sdk-test-java/src/main/java/com/floci/test/TestFixtures.java
@@ -37,6 +37,7 @@ import software.amazon.awssdk.services.sqs.SqsClient;
import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.awssdk.services.sts.StsClient;
import software.amazon.awssdk.services.kafka.KafkaClient;
+import software.amazon.awssdk.services.mq.MqClient;
import software.amazon.awssdk.services.athena.AthenaClient;
import software.amazon.awssdk.services.glue.GlueClient;
import software.amazon.awssdk.services.firehose.FirehoseClient;
@@ -383,6 +384,14 @@ public final class TestFixtures {
.build();
}
+ public static MqClient mqClient() {
+ return MqClient.builder()
+ .endpointOverride(ENDPOINT)
+ .region(REGION)
+ .credentialsProvider(CREDENTIALS)
+ .build();
+ }
+
public static AthenaClient athenaClient() {
return AthenaClient.builder()
.endpointOverride(ENDPOINT)
diff --git a/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AmazonMqTest.java b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AmazonMqTest.java
new file mode 100644
index 0000000000..ffffdd3661
--- /dev/null
+++ b/compatibility-tests/sdk-test-java/src/test/java/com/floci/test/AmazonMqTest.java
@@ -0,0 +1,161 @@
+package com.floci.test;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
+import software.amazon.awssdk.services.mq.MqClient;
+import software.amazon.awssdk.services.mq.model.BrokerState;
+import software.amazon.awssdk.services.mq.model.CreateBrokerRequest;
+import software.amazon.awssdk.services.mq.model.CreateBrokerResponse;
+import software.amazon.awssdk.services.mq.model.CreateUserRequest;
+import software.amazon.awssdk.services.mq.model.DeleteBrokerRequest;
+import software.amazon.awssdk.services.mq.model.DeploymentMode;
+import software.amazon.awssdk.services.mq.model.DescribeBrokerRequest;
+import software.amazon.awssdk.services.mq.model.DescribeBrokerResponse;
+import software.amazon.awssdk.services.mq.model.EngineType;
+import software.amazon.awssdk.services.mq.model.ListBrokersRequest;
+import software.amazon.awssdk.services.mq.model.MqException;
+import software.amazon.awssdk.services.mq.model.User;
+
+import java.time.Duration;
+import java.time.Instant;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+/**
+ * Exercises the real RabbitMQ container path: CreateBroker provisions a
+ * rabbitmq:3-management container, the broker transitions to RUNNING once its
+ * management API answers, and the AMQP/console endpoints are published. Also
+ * confirms the AWS-faithful rejection of the ActiveMQ-only User API on RabbitMQ.
+ *
+ * Requires a running Floci with {@code amazonmq.mock=false} and a working
+ * Docker daemon. When the broker never reaches RUNNING (Docker unavailable in
+ * CI), the dependent assertions skip rather than fail.
+ */
+@DisplayName("Amazon MQ (RabbitMQ)")
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+class AmazonMqTest {
+
+ private static MqClient mq;
+ private static String brokerId;
+ private static boolean reachedRunning;
+ private static final String BROKER_NAME = TestFixtures.uniqueName("mq-broker");
+
+ @BeforeAll
+ static void setup() {
+ mq = TestFixtures.mqClient();
+ }
+
+ @AfterAll
+ static void cleanup() {
+ if (mq != null) {
+ if (brokerId != null) {
+ try {
+ mq.deleteBroker(DeleteBrokerRequest.builder().brokerId(brokerId).build());
+ } catch (Exception ignored) {}
+ }
+ mq.close();
+ }
+ }
+
+ @Test
+ @Order(1)
+ void createBroker() {
+ CreateBrokerResponse response = mq.createBroker(CreateBrokerRequest.builder()
+ .brokerName(BROKER_NAME)
+ .engineType(EngineType.RABBITMQ)
+ .engineVersion("3.13")
+ .deploymentMode(DeploymentMode.SINGLE_INSTANCE)
+ .hostInstanceType("mq.t3.micro")
+ .publiclyAccessible(false)
+ .autoMinorVersionUpgrade(true)
+ .users(User.builder()
+ .username("admin")
+ .password("AdminPass123")
+ .consoleAccess(true)
+ .build())
+ .build());
+
+ assertThat(response.brokerId()).isNotNull();
+ assertThat(response.brokerArn()).contains(":mq:");
+ brokerId = response.brokerId();
+ }
+
+ @Test
+ @Order(2)
+ void brokerReachesRunningWithEndpoints() {
+ requireBroker();
+
+ DescribeBrokerResponse describe = waitForState(BrokerState.RUNNING, Duration.ofSeconds(120));
+ Assumptions.assumeTrue(describe != null,
+ "Broker did not reach RUNNING (Docker likely unavailable); skipping endpoint checks");
+
+ reachedRunning = true;
+ assertThat(describe.brokerName()).isEqualTo(BROKER_NAME);
+ assertThat(describe.engineType()).isEqualTo(EngineType.RABBITMQ);
+ assertThat(describe.brokerInstances()).isNotEmpty();
+ assertThat(describe.brokerInstances().get(0).endpoints().get(0)).startsWith("amqp://");
+ assertThat(describe.brokerInstances().get(0).consoleURL()).startsWith("http://");
+ }
+
+ @Test
+ @Order(3)
+ void listBrokersIncludesCreated() {
+ requireBroker();
+
+ var response = mq.listBrokers(ListBrokersRequest.builder().build());
+ assertThat(response.brokerSummaries()).anyMatch(b -> b.brokerId().equals(brokerId));
+ }
+
+ @Test
+ @Order(4)
+ void userApiRejectedForRabbitMq() {
+ requireBroker();
+
+ // The standalone User API is ActiveMQ-only; AWS rejects it for RabbitMQ.
+ assertThatThrownBy(() -> mq.createUser(CreateUserRequest.builder()
+ .brokerId(brokerId)
+ .username("alice")
+ .password("AnotherPass99")
+ .build()))
+ .isInstanceOf(MqException.class);
+ }
+
+ @Test
+ @Order(5)
+ void deleteBroker() {
+ requireBroker();
+
+ var response = mq.deleteBroker(DeleteBrokerRequest.builder().brokerId(brokerId).build());
+ assertThat(response.brokerId()).isEqualTo(brokerId);
+ brokerId = null;
+ }
+
+ private DescribeBrokerResponse waitForState(BrokerState target, Duration timeout) {
+ Instant deadline = Instant.now().plus(timeout);
+ while (Instant.now().isBefore(deadline)) {
+ DescribeBrokerResponse describe = mq.describeBroker(
+ DescribeBrokerRequest.builder().brokerId(brokerId).build());
+ if (describe.brokerState() == target) {
+ return describe;
+ }
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ break;
+ }
+ }
+ return null;
+ }
+
+ private static void requireBroker() {
+ Assumptions.assumeTrue(brokerId != null, "Broker must exist from earlier ordered test");
+ }
+}
diff --git a/docs/index.md b/docs/index.md
index 719d3098f5..b44de44433 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -12,7 +12,7 @@ Floci is a fast, free, and open-source local AWS service emulator built for deve
## Supported Services
-Floci emulates 65 AWS services. See the [Services Overview](services/index.md) for per-service operation counts, endpoints, and full protocol details.
+Floci emulates 66 AWS services. See the [Services Overview](services/index.md) for per-service operation counts, endpoints, and full protocol details.
| Service | Protocol |
|---|---|
@@ -40,6 +40,7 @@ Floci emulates 65 AWS services. See the [Services Overview](services/index.md) f
| Neptune (graph DB / Gremlin) | Query + WebSocket proxy |
| DocumentDB (MongoDB-compatible) | Query + MongoDB wire |
| MSK (Kafka / Redpanda) | REST JSON + Kafka |
+| Amazon MQ (RabbitMQ) | REST JSON + AMQP |
| Athena | JSON 1.1 |
| Glue Data Catalog + Schema Registry | JSON 1.1 |
| Data Firehose | JSON 1.1 |
@@ -109,7 +110,7 @@ docker compose up -d
aws --endpoint-url http://localhost:4566 s3 mb s3://my-bucket
```
-All 65 AWS services are immediately available at `http://localhost:4566`.
+All 66 AWS services are immediately available at `http://localhost:4566`.
[Get started →](getting-started/quick-start.md){ .md-button .md-button--primary }
[View services →](services/index.md){ .md-button }
diff --git a/docs/services/amazonmq.md b/docs/services/amazonmq.md
new file mode 100644
index 0000000000..c88eccbf47
--- /dev/null
+++ b/docs/services/amazonmq.md
@@ -0,0 +1,81 @@
+# Amazon MQ (RabbitMQ)
+
+**Protocol:** REST-JSON
+**Endpoint:** `http://localhost:4566/`
+
+Floci emulates Amazon MQ by orchestrating **RabbitMQ** containers. Each broker is
+backed by a real `rabbitmq:3-management` container, so AMQP clients and the RabbitMQ
+management console work against the published endpoints.
+
+Only the **RabbitMQ** engine and the `SINGLE_INSTANCE` deployment mode are supported;
+`CreateBroker` rejects `ACTIVEMQ` and the multi-AZ deployment modes.
+
+## Supported Actions
+
+| Action | Description |
+|---|---|
+| `CreateBroker` | Provisions a RabbitMQ container and seeds the admin user |
+| `DescribeBroker` | Get broker metadata, state, and connection endpoints |
+| `ListBrokers` | List all emulated brokers |
+| `DeleteBroker` | Stops and removes the RabbitMQ container |
+| `RebootBroker` | Reboots the broker |
+
+### User management
+
+Amazon MQ's user API (`CreateUser`, `DescribeUser`, `ListUsers`, `UpdateUser`,
+`DeleteUser`) applies **only to ActiveMQ** brokers. As on real AWS, Floci rejects these
+operations for RabbitMQ brokers with a `BadRequestException`. Manage RabbitMQ users
+through the RabbitMQ management console. The broker's initial administrator is supplied
+in the `CreateBroker` `Users` list (exactly one user is required) and seeded into the
+container.
+
+## Configuration
+
+| Variable | Default | Description |
+|---|---|---|
+| `FLOCI_SERVICES_AMAZONMQ_ENABLED` | `true` | Enable or disable the service |
+| `FLOCI_SERVICES_AMAZONMQ_MOCK` | `false` | `true` = metadata-only CRUD, no Docker containers |
+| `FLOCI_SERVICES_AMAZONMQ_DEFAULT_IMAGE` | `rabbitmq:3-management` | Docker image for RabbitMQ broker containers |
+
+## How it works
+
+When `mock` is set to `false` (default), Floci uses the Docker API to start a RabbitMQ
+container for each created broker. For Docker socket setup, private registry
+authentication, and other Docker settings see [Docker Configuration](../configuration/docker.md).
+
+- **Port Mapping**: The AMQP port (5672) and the management UI (15672) are each mapped to
+ a dynamic host port. Use the endpoints returned by `DescribeBroker` rather than a fixed
+ port.
+- **Admin user**: The `CreateBroker` user is seeded via `RABBITMQ_DEFAULT_USER` /
+ `RABBITMQ_DEFAULT_PASS`. Unlike the built-in `guest` user (which RabbitMQ restricts to
+ loopback connections), this user can authenticate over the mapped port.
+- **Persistence**: Each broker gets a named Docker volume. In memory mode the volume is
+ removed on broker delete; in persistent modes it is retained unless
+ `FLOCI_STORAGE_PRUNE_VOLUMES_ON_DELETE=true`.
+- **Readiness**: The broker state transitions to `RUNNING` once the RabbitMQ management
+ API answers on its port.
+
+## Examples
+
+```bash
+export AWS_ENDPOINT_URL=http://localhost:4566
+
+# Create a broker (exactly one admin user is required for RabbitMQ)
+aws mq create-broker \
+ --broker-name my-broker \
+ --engine-type RABBITMQ \
+ --engine-version "3.13" \
+ --deployment-mode SINGLE_INSTANCE \
+ --host-instance-type mq.t3.micro \
+ --no-publicly-accessible \
+ --auto-minor-version-upgrade \
+ --users '[{"Username":"admin","Password":"AdminPass123","ConsoleAccess":true}]' \
+ --endpoint-url $AWS_ENDPOINT_URL
+
+# Describe a broker (poll until BrokerState is RUNNING)
+BROKER_ID=$(aws mq list-brokers --query 'BrokerSummaries[0].BrokerId' --output text --endpoint-url $AWS_ENDPOINT_URL)
+aws mq describe-broker --broker-id $BROKER_ID --endpoint-url $AWS_ENDPOINT_URL
+
+# Delete a broker
+aws mq delete-broker --broker-id $BROKER_ID --endpoint-url $AWS_ENDPOINT_URL
+```
diff --git a/docs/services/index.md b/docs/services/index.md
index c92330aef4..213f539d29 100644
--- a/docs/services/index.md
+++ b/docs/services/index.md
@@ -1,6 +1,6 @@
# Services Overview
-Floci emulates 65 AWS services on a single port (`4566`). All services use the real AWS wire protocol, your existing AWS CLI commands and SDK clients work without modification.
+Floci emulates 66 AWS services on a single port (`4566`). All services use the real AWS wire protocol, your existing AWS CLI commands and SDK clients work without modification.
This page is the canonical reference for supported service and operation counts. Some services expose separate control-plane and data-plane rows below. Other docs (and the README) should link here rather than duplicating the table.
@@ -37,6 +37,7 @@ Operation counts are exact. For dispatch-table services (Query and JSON 1.1) eac
| [RDS](rds.md) | `POST /` with `Action=` param + TCP proxy | Query + wire | 14 |
| [RDS Data API](rds-data.md) | `/Execute`, `/BeginTransaction`, `/CommitTransaction`, `/RollbackTransaction` | REST JSON | 4 |
| [MSK](msk.md) | `/v1/clusters/...`, `/api/v2/clusters/...` + Redpanda broker | REST JSON + Kafka | 8 |
+| [Amazon MQ](amazonmq.md) | `/v1/brokers/...` + RabbitMQ broker | REST JSON + AMQP | 5 |
| [Athena](athena.md) | `POST /` + `X-Amz-Target: AmazonAthena.*` | JSON 1.1 | 4 |
| [Glue](glue.md) | `POST /` + `X-Amz-Target: AWSGlue.*` | JSON 1.1 | 38 |
| [Neptune](neptune.md) | `POST /` with `Action=` param + Gremlin TCP proxy | Query + WebSocket | 8 |
diff --git a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
index fa4ca09960..35f1503ed0 100644
--- a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
+++ b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java
@@ -416,6 +416,7 @@ public interface EmulatorConfig {
ApiGatewayServiceConfig apigateway();
IamServiceConfig iam();
MskServiceConfig msk();
+ AmazonMqServiceConfig amazonmq();
ElastiCacheServiceConfig elasticache();
MemoryDbServiceConfig memorydb();
RdsServiceConfig rds();
@@ -659,6 +660,17 @@ public interface EmulatorConfig {
int kafkaHostPortMax();
}
+ interface AmazonMqServiceConfig {
+ @WithDefault("true")
+ boolean enabled();
+
+ @WithDefault("false")
+ boolean mock();
+
+ @WithDefault("rabbitmq:3-management")
+ String defaultImage();
+ }
+
interface ElastiCacheServiceConfig {
@WithDefault("true")
boolean enabled();
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java b/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
index 007651918a..ee3b3d0252 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/ResolvedServiceCatalog.java
@@ -80,6 +80,10 @@ public class ResolvedServiceCatalog {
"msk", config.storage().mode(), 5000L, null, ServiceProtocol.REST_JSON,
protocols(ServiceProtocol.REST_JSON),
Set.of(), Set.of("kafka"), Set.of(), Set.of(io.github.hectorvent.floci.services.msk.MskController.class)),
+ descriptor("mq", "amazonmq", config.services().amazonmq().enabled(), true,
+ "amazonmq", config.storage().mode(), 5000L, null, ServiceProtocol.REST_JSON,
+ protocols(ServiceProtocol.REST_JSON),
+ Set.of(), Set.of("mq"), Set.of(), Set.of(io.github.hectorvent.floci.services.amazonmq.AmazonMqController.class)),
descriptor("sts", "iam", config.services().iam().enabled(), false,
null, null, 5000L, AwsNamespaces.STS, ServiceProtocol.QUERY,
protocols(ServiceProtocol.QUERY),
diff --git a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
index fe36bf14dd..effbe02fc0 100644
--- a/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
+++ b/src/main/java/io/github/hectorvent/floci/lifecycle/EmulatorLifecycle.java
@@ -8,6 +8,7 @@ import io.github.hectorvent.floci.lifecycle.inithook.InitializationHooksRunner;
import io.github.hectorvent.floci.services.ec2.Ec2MetadataServer;
import io.github.hectorvent.floci.services.ecr.registry.EcrRegistryManager;
import io.github.hectorvent.floci.services.floci.ui.FlociUiManager;
+import io.github.hectorvent.floci.services.amazonmq.container.RabbitMqManager;
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheContainerManager;
import io.github.hectorvent.floci.services.elasticache.container.ElastiCacheMemcachedContainerManager;
import io.github.hectorvent.floci.services.elasticache.proxy.ElastiCacheProxyManager;
@@ -69,6 +70,7 @@ public class EmulatorLifecycle {
private final DocDbContainerManager docDbContainerManager;
private final NeptuneContainerManager neptuneContainerManager;
private final NeptuneProxyManager neptuneProxyManager;
+ private final RabbitMqManager rabbitMqManager;
private final RdsService rdsService;
private final InitializationHooksRunner initializationHooksRunner;
private final SqsEventSourcePoller sqsPoller;
@@ -93,6 +95,7 @@ public class EmulatorLifecycle {
DocDbContainerManager docDbContainerManager,
NeptuneContainerManager neptuneContainerManager,
NeptuneProxyManager neptuneProxyManager,
+ RabbitMqManager rabbitMqManager,
RdsService rdsService,
InitializationHooksRunner initializationHooksRunner,
SqsEventSourcePoller sqsPoller,
@@ -116,6 +119,7 @@ public class EmulatorLifecycle {
this.docDbContainerManager = docDbContainerManager;
this.neptuneContainerManager = neptuneContainerManager;
this.neptuneProxyManager = neptuneProxyManager;
+ this.rabbitMqManager = rabbitMqManager;
this.rdsService = rdsService;
this.initializationHooksRunner = initializationHooksRunner;
this.sqsPoller = sqsPoller;
@@ -252,6 +256,7 @@ public class EmulatorLifecycle {
memoryDbContainerManager.stopAll();
docDbContainerManager.stopAll();
neptuneContainerManager.stopAll();
+ rabbitMqManager.stopAll();
ecrRegistryManager.shutdown();
flociUiManager.shutdown();
storageFactory.shutdownAll();
diff --git a/src/main/java/io/github/hectorvent/floci/services/amazonmq/AmazonMqController.java b/src/main/java/io/github/hectorvent/floci/services/amazonmq/AmazonMqController.java
new file mode 100644
index 0000000000..e836c5d952
--- /dev/null
+++ b/src/main/java/io/github/hectorvent/floci/services/amazonmq/AmazonMqController.java
@@ -0,0 +1,211 @@
+package io.github.hectorvent.floci.services.amazonmq;
+
+import io.github.hectorvent.floci.services.amazonmq.model.Broker;
+import io.github.hectorvent.floci.services.amazonmq.model.MqUser;
+import jakarta.inject.Inject;
+import jakarta.ws.rs.*;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Amazon MQ control plane (REST JSON). Paths and wire keys mirror the AWS
+ * {@code mq} API (camelCase bodies under {@code /v1/brokers}).
+ */
+@Path("/")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+public class AmazonMqController {
+
+ private final AmazonMqService service;
+
+ @Inject
+ public AmazonMqController(AmazonMqService service) {
+ this.service = service;
+ }
+
+ @POST
+ @Path("/v1/brokers")
+ public Response createBroker(Map request) {
+ CreateBrokerParams params = new CreateBrokerParams(
+ str(request, "brokerName"),
+ str(request, "engineType"),
+ str(request, "engineVersion"),
+ str(request, "deploymentMode"),
+ str(request, "hostInstanceType"),
+ bool(request, "publiclyAccessible"),
+ bool(request, "autoMinorVersionUpgrade"),
+ parseUsers(request.get("users")),
+ tags(request.get("tags")));
+ Broker broker = service.createBroker(params);
+ return Response.ok(Map.of(
+ "brokerArn", broker.getBrokerArn(),
+ "brokerId", broker.getBrokerId())).build();
+ }
+
+ @GET
+ @Path("/v1/brokers")
+ public Response listBrokers() {
+ List