- Java 11+
- Docker (for RabbitMQ) OR RabbitMQ installed locally
- Maven 3.6+ (for building from source)
The easiest way to get started:
# 1. Start RabbitMQ in Docker
./start_rabbitmq.sh
# 2. Build and run the adapter (in a new terminal)
./build_and_run.sh
# 3. Open browser
http://localhost:52345
# 4. Click "Send Get Adapter Info" button
# Watch the logs to see the message being processed!That's it! The scripts handle everything automatically.
If you prefer to do things manually or want more control:
docker run -d --name rabbitmq \
-p 5672:5672 \
-p 15672:15672 \
rabbitmq:3-managementThis starts RabbitMQ with:
- AMQP port: 5672
- Management UI: http://localhost:15672 (guest/guest)
# Start RabbitMQ service
sudo service rabbitmq-server start
# Or on macOS:
brew services start rabbitmqmvn clean package -DskipTestsThis creates: target/obp-rabbit-cats-adapter-1.0.0-SNAPSHOT.jar (~37MB)
Create a .env file (or copy from .env.example):
# HTTP Server (Discovery Page)
HTTP_HOST=0.0.0.0
HTTP_PORT=52345
HTTP_ENABLED=true
# RabbitMQ Configuration
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_VIRTUAL_HOST=/
RABBITMQ_USERNAME=guest
RABBITMQ_PASSWORD=guest
RABBITMQ_REQUEST_QUEUE=obp.request
RABBITMQ_RESPONSE_QUEUE=obp.response
RABBITMQ_PREFETCH_COUNT=10
# CBS Configuration (Mock)
CBS_BASE_URL=http://localhost:9000
CBS_AUTH_TYPE=none
CBS_TIMEOUT=30
CBS_MAX_RETRIES=3
# Telemetry
ENABLE_METRICS=true
LOG_LEVEL=INFO# Export environment variables
export $(cat .env | xargs)
# Run the adapter
java -jar target/obp-rabbit-cats-adapter-1.0.0-SNAPSHOT.jarYou should see:
===============================================================
OBP Rabbit Cats Adapter
Version 1.0.0-SNAPSHOT
===============================================================
[CONFIG] Loading configuration...
[OK] Configuration loaded
HTTP Server: 0.0.0.0:52345
RabbitMQ: localhost:5672
Request Queue: obp.request
Response Queue: obp.response
CBS Base URL: http://localhost:9000
[CONFIG] Validating configuration...
[OK] Configuration valid
[TELEMETRY] Initialized (Console mode)
[CBS] Initializing local adapter...
[OK] Local Adapter: Mock-Local-Adapter v1.0.0
[HEALTH] Checking CBS health...
[OK] CBS is healthy
[STARTUP] Starting services...
[HTTP] Discovery server started at http://0.0.0.0:52345
[INFO] Visit http://localhost:52345 to see service info
[RabbitMQ] Connected to localhost:5672
[Queue] Request: obp.request
[Queue] Response: obp.response
[OK] Consuming from queue: obp.request
-
Open your browser to http://localhost:52345
-
You'll see the OBP Adapter Discovery page with:
- Health & Status endpoints
- RabbitMQ connection info
- CBS configuration
- Test Messages section
-
Click the "Send Get Adapter Info" button in the Test Messages card
-
You should see:
- Success message with correlation ID
- Message processed in the adapter logs
- Response returned from Mock CBS
-
Check the adapter console logs:
[TEST] Sent message: obp.getAdapterInfo with correlation ID: 123e4567-e89b-12d3-a456-426614174000
[123e4567-e89b-12d3-a456-426614174000] Processing: obp.getAdapterInfo
[123e4567-e89b-12d3-a456-426614174000] [OK] Completed in 45ms
-
Open http://localhost:15672 (guest/guest)
-
Go to Queues tab
-
You should see:
obp.requestqueueobp.responsequeue
-
Click on
obp.requestqueue -
Under Publish message, paste this JSON:
{
"messageType": "obp.getAdapterInfo",
"data": {},
"outboundAdapterCallContext": {
"correlationId": "test-123",
"sessionId": "test-session",
"generalContext": {}
}
}-
Click Publish message
-
Go to
obp.responsequeue and click Get messages -
You should see the response:
{
"status": {
"errorCode": ""
},
"data": {
"name": "Mock-Local-Adapter",
"version": "1.0.0",
"git_commit": "mock-commit-123",
"date": "2025-01-14"
},
"inboundAdapterCallContext": {
"correlationId": "test-123",
"sessionId": "test-session"
}
}# Health check
curl http://localhost:52345/health
# Readiness check
curl http://localhost:52345/ready
# Service info
curl http://localhost:52345/infoThe adapter logs all activity to the console with correlation IDs:
[INFO][CID: test-123] Message received: type=obp.getAdapterInfo
[INFO][CID: test-123] CBS operation started: getAdapterInfo
[INFO][CID: test-123] CBS operation success: getAdapterInfo duration=10ms
[INFO][CID: test-123] Response sent: type=response success=true
Monitor queue metrics at http://localhost:15672:
- Message rates
- Queue depth
- Consumer count
- Connection status
Browser/Client
|
| POST /test/adapter-info
v
Discovery Server (HTTP)
|
| Publish to obp.request queue
v
RabbitMQ
|
| Consume from obp.request
v
RabbitMQ Consumer
|
| Parse & route message
v
Local Adapter (Mock)
|
| Process business logic
v
CBS Response
|
| Publish to obp.response queue
v
RabbitMQ
|
| (OBP-API would consume this)
v
Response Queue
- ✅ Automatically loads
.envfile - ✅ Checks if RabbitMQ is reachable
- ✅ Shows configuration before starting
- ✅ Handles environment variable export
- ✅ Finds the JAR automatically
- ✅ Cleaner output with no emojis
- ✅ Checks if Docker is installed and running
- ✅ Reuses existing RabbitMQ container if present
- ✅ Waits for RabbitMQ to be fully ready
- ✅ Shows all connection information
- ✅ Provides useful management commands
⚠️ More control but more typing⚠️ Need to remember all commands⚠️ Must manually export environment variables⚠️ Good for understanding what's happening under the hood
Recommendation: Use the scripts for daily work, use manual steps when learning or troubleshooting.
The Mock Local Adapter supports these message types:
obp.getAdapterInfo- Get adapter informationobp.getBank- Get bank detailsobp.getBankAccount- Get account informationobp.getTransaction- Get transaction detailsobp.getTransactions- Get transaction listobp.checkFundsAvailable- Check available fundsobp.makePayment- Make a payment
[ERROR] RabbitMQ error: Connection refused
Solution: Make sure RabbitMQ is running:
docker ps | grep rabbitmq
# or
sudo service rabbitmq-server status[ERROR] Failed to bind to 0.0.0.0:52345
Solution: Change the HTTP port:
export HTTP_PORT=8081Solution: The adapter automatically declares queues on startup. Check RabbitMQ management UI to verify.
Check:
- Message JSON format is correct
messageTypefield existsoutboundAdapterCallContexthascorrelationId- Queue names match configuration
-
Implement Your Local Adapter: Replace
MockLocalAdapterwith your bank's implementation- See
HOW-BANKS-USE-THIS.md - See
ARCHITECTURE.md
- See
-
Add More Message Types: Implement additional OBP message handlers in your connector
-
Configure Production Settings:
- Change RabbitMQ credentials
- Set up SSL/TLS
- Configure retry policies
- Set up proper logging
-
Deploy: See
README.mdfor Docker and Kubernetes deployment options
- Architecture:
ARCHITECTURE.md - Bank Integration:
HOW-BANKS-USE-THIS.md - Full README:
README.md - OBP Wiki: https://github.com/OpenBankProject/OBP-API/wiki