{"id":19446153,"url":"https://github.com/maciejwalkowiak/spring-boot-spring-amqp-java8-lombok-sample","last_synced_at":"2026-03-03T23:02:40.694Z","repository":{"id":145847572,"uuid":"65841931","full_name":"maciejwalkowiak/spring-boot-spring-amqp-java8-lombok-sample","owner":"maciejwalkowiak","description":null,"archived":false,"fork":false,"pushed_at":"2019-03-01T15:46:24.000Z","size":23,"stargazers_count":14,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-22T00:58:55.171Z","etag":null,"topics":["java","java8","lombok","spring","spring-amqp","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maciejwalkowiak.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-16T17:57:31.000Z","updated_at":"2024-04-15T09:42:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7eac600f-f111-40f1-b0bb-d20fe5cbdbe0","html_url":"https://github.com/maciejwalkowiak/spring-boot-spring-amqp-java8-lombok-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maciejwalkowiak/spring-boot-spring-amqp-java8-lombok-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maciejwalkowiak","download_url":"https://codeload.github.com/maciejwalkowiak/spring-boot-spring-amqp-java8-lombok-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30064791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java8","lombok","spring","spring-amqp","spring-boot"],"created_at":"2024-11-10T16:13:05.344Z","updated_at":"2026-03-03T23:02:40.679Z","avatar_url":"https://github.com/maciejwalkowiak.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot + Spring AMQP + Java 8 Optional and Dates + Lombok Sample\n\nSample RabbitMQ producer and consumer application with minimum setup.\n\nProject contains two submodules:\n\n- **producer** - with an example how to send message to RabbitMQ.\n- **consumer** - with an example how to retrieve message from RabbitMQ.\n\nBoth projects use [Lombok](https://projectlombok.org) to minimise the boilerplate.\n\n## Hints\n\n- in order to enable Jackson to (de)serialize `java.util.Optional` following dependency has to be added:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fasterxml.jackson.datatype\u003c/groupId\u003e\n    \u003cartifactId\u003ejackson-datatype-jdk8\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n- in order to enable Jackson to (de)serialize Java 8 date formats following dependency has to be added:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fasterxml.jackson.datatype\u003c/groupId\u003e\n    \u003cartifactId\u003ejackson-datatype-jsr310\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n- to keep objects containing data passed in a message immutable, they annotated with Lombok `@Value`.\nSince Lombok version 1.16.20, you need to explicitly instruct it to generate `@ConstructorProperties` by adding following line to `lombok.config` file:\n\n```\nlombok.anyConstructor.suppressConstructorProperties=false\n```\n\n- by default **Spring AMQP** does not utilize Spring Boot configured Jackson `ObjectMapper`. To take the advantage of Jackson autoconfiguration you need to add following bean:\n\n```java\n@Bean\nMessageConverter messageConverter(ObjectMapper objectMapper) {\n    return new Jackson2JsonMessageConverter(objectMapper);\n}\n```\n\n- to test reliably if message gets send and received, in integration tests you should use anonymous queues so that each listener in each concurrently running application context has its own queue and listeners do not hijack messages from each other causing tests to fail randomly.\nThis is why it's a good idea to externalise properties like *queue name*, *routing key*, *exchange* to `@ConfigurationProperties` classes\n- integration testing of the listener should only cover if message gets received and if it's deserialized properly. Testing the logic should not be a part of an integration test\n- to write integration test for a listener following dependency has to be added:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.springframework.amqp\u003c/groupId\u003e\n    \u003cartifactId\u003espring-rabbit-test\u003c/artifactId\u003e\n    \u003cversion\u003e${spring-amqp.version}\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\nwhere `spring-amqp.version` is a property coming from *Spring Boot* parent project - you don't need to specify this version by yourself.\n\n- to take the advantage of `spring-rabbit-test`,  `@RabbitListenerTest(capture = true)` needs to be added to test configuration setup. Check [RabbitTestConfiguration](./consumer/src/test/java/consumer/RabbitTestConfiguration.java)\n- check [BookListenerTest](./consumer/src/test/java/consumer/BookListenerTest.java) to see an example integration test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaciejwalkowiak%2Fspring-boot-spring-amqp-java8-lombok-sample/lists"}