This application processes orders from an e-commerce platform and distributes them to CRM and Financial systems.
- Java 21 or higher
- Maven 3.8+
- Docker and Docker Compose
- Git
git clone https://github.com/igorbljahhin/integration-test-task.git
cd integration-test-task
The application uses the following configuration files:
core/src/main/resources/application-dev.yml
- Development configurationcore/src/main/resources/application-prod.yml
- Production configuration (create if needed)
Default configuration values can be overridden using environment variables:
export APP_CRM_API_URL=http://localhost:4010
export APP_FINANCIAL_OUTPUT_DIRECTORY=./financial-output
Start RabbitMQ and Mock CRM service using Docker Compose:
docker-compose up -d
Verify services are running:
docker-compose ps
The following services should be available:
- RabbitMQ Management Console: http://localhost:15672 (guest/guest)
- Mock CRM API: http://localhost:4010
mvn clean package
Development mode:
java -jar core/target/integration-test-task.jar
Production mode:
java -jar core/target/integration-test-task.jar --spring.profiles.active=prod
Run unit tests:
mvn test
- Ensure Docker services are running:
docker-compose up -d
- Run integration tests:
mvn verify
-
Access RabbitMQ Management Console:
- URL: http://localhost:15672
- Username: guest
- Password: guest
- Navigate to "Queues" tab to verify
orderCreated-queue
exists
-
Send test message to RabbitMQ:
curl -X POST \
http://localhost:15672/api/exchanges/%2F/amq.default/publish \
-u guest:guest \
-H 'Content-Type: application/json' \
-d '{
"properties": {},
"routing_key": "orderCreated-queue",
"payload": "{\"orderId\":\"ORD123\",\"status\":\"paid\",\"customerId\":\"CUST456\"}",
"payload_encoding": "string"
}'
- Verify output:
- Check CRM mock service logs:
docker-compose logs -f mock-crm
- Check financial output directory for CSV files:
ls -l financial-output/
- Check CRM mock service logs:
-
Port Conflicts
- RabbitMQ ports (5672, 15672) already in use
- Mock CRM port (4010) already in use
Solution: Stop conflicting services or modify ports in docker-compose.yml
-
Permission Issues
- Financial output directory not writable
Solution: Check directory permissions:
chmod 755 financial-output/
-
RabbitMQ Connection Issues
Solution: Verify RabbitMQ is running and credentials are correct:
docker-compose ps rabbitmq docker-compose logs rabbitmq
Application logs are written to:
- Console (default)
To enable debug logging, modify application-dev.yml
:
logging:
level:
com.example.ecommerceorderprocessor: DEBUG
org.springframework.integration: DEBUG
Access the health endpoint (if Spring Actuator is enabled):
curl http://localhost:8080/actuator/health