This project contains the implementation of AWS Lambda functions for processing outgoing sqs messages from mParticle.
- Java Development Kit (JDK) 21 or later
- Gradle
- AWS CLI configured with appropriate permissions
- Login to JVM using the production readonly profile:
jvm_login - using prod readonly profile
Build the project:
Use Gradle to build the project. This will compile the source code and package it.
./gradlew build
Testing in sandbox uses localstack. It's pretty straightforward:
./gradlew buildZip
doco up -d mparticle-outgoing-lambda
Getting the logs from that thing is a lot more hassle though. Recommended approach:
docker ps |grep localstack-lambda-mparticle-outgoing-message-processor
- this should give you the Docker container which is running the processordocker logs -f <container_name>
You'll have much better luck writing a unit test to reproduce the condition. Really.
It's somewhat possible to debug but it's a bit of a pain. Basically:
- Edit the script in
devtools/containers/localstack/lambda/mparticle-outgoing.sh
withsuspend=y
(or alternatively send a ton of messages) docker ps |grep localstack-lambda-mparticle-outgoing-message-processor
. You will see a port mapping that will look like this:0.0.0.0:64171->9929/tcp
. The number after the first colon is the debug port.- Set up IntelliJ for remote debugging on that port
- Place your breakpoints and start your debugger
There is very very little time to connect - as soon as the lambda ends, the port will not allow connection anymore. Also, you have 900 seconds to connect when suspend=y before it dies on you, so be quick!