Skip to content

Latest commit

 

History

History
75 lines (49 loc) · 2.16 KB

File metadata and controls

75 lines (49 loc) · 2.16 KB

Instructions for AI Agents

Overview

This is the RabbitMQ Java client, an AMQP 0-9-1 client library.

Consult the API guide to learn about how this library is supposed to be used.

Supported Java Versions

This client supports Java 8+.

Build and Test

make deps
./mvnw clean compile
./mvnw spotless:apply

Running Tests

Tests require a RabbitMQ node on localhost:5672 with the default localhost-scoped credentials (guest/guest):

# start a RabbitMQ node in a container
docker run -it --rm --name rabbitmq -p 5672:5672 rabbitmq
./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq

To run a single test:

./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq -Dit.test=DeadLetterExchange

Repository Layout

  • src/main/java/com/rabbitmq/client: the public API
  • src/main/java/com/rabbitmq/client/impl: internal packages
  • src/main/java/com/rabbitmq/client/impl/recovery: automatic connection recovery implementation
  • src/test/java: tests
  • deps/rabbitmq_codegen: AMQP 0-9-1 framing code generation tooling (requires Python 3)
  • target/generated-sources: the AMQP 0-9-1 framing code generated by rabbitmq_codegen
  • codegen.py: a Python 3 script that drives the code generation process

Key Files

Under src/main/java/com/rabbitmq/client:

  • ConnectionFactory.java: entry point for creating connections
  • Connection.java, Channel.java: key connection and channel interfaces
  • impl/AMQConnection.java, impl/ChannelN.java: connection and channelimplementations
  • impl/recovery/AutorecoveringConnection.java: a Connection implementation that supports automatic recovery

Code Style

  • Format code with ./mvnw spotless:apply at the end of each task

Comments

  • Only add very important comments, both in tests and in the implementation

Git Instructions

  • Never add yourself to the list of commit co-authors
  • Never mention yourself in commit messages in any way (no "Generated by", no AI tool links, etc)

Style Guide

  • Never add full stops to Markdown list items