Skip to content

Commit

Permalink
SqsMessageListenerContainerFactory and SqsMessageListenerContainer cl…
Browse files Browse the repository at this point in the history
…asses javadoc examples are fixed (#1102)
  • Loading branch information
sefabal authored and maciejwalkowiak committed Mar 17, 2024
1 parent 318b36e commit 05db765
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@
* beans implementing these interfaces will be set to the default factory.
* <p>
* Example using the builder:
*
*
* <pre>
* <code>
* &#064;Bean
* SqsMessageListenerContainerFactory<Object> defaultSqsListenerContainerFactory(SqsAsyncClient sqsAsyncClient) {
* return SqsMessageListenerContainerFactory
* .builder()
* .configure(options -> options
* .messagesPerPoll(5)
* .maxMessagesPerPoll(5)
* .pollTimeout(Duration.ofSeconds(10)))
* .sqsAsyncClient(sqsAsyncClient)
* .build();
Expand All @@ -84,35 +84,35 @@
*
* <p>
* Example using the default constructor:
*
*
* <pre>
* <code>
* &#064;Bean
* SqsMessageListenerContainerFactory<Object> defaultSqsListenerContainerFactory(SqsAsyncClient sqsAsyncClient) {
* SqsMessageListenerContainerFactory<Object> factory = new SqsMessageListenerContainerFactory<>();
* factory.setSqsAsyncClient(sqsAsyncClient);
* factory.configure(options -> options
* .messagesPerPoll(5)
* .maxMessagesPerPoll(5)
* .pollTimeout(Duration.ofSeconds(10)));
* return factory;
* }
* </code>
* </pre>
* <p>
* Example creating a container manually:
*
*
* <pre>
* <code>
* &#064;Bean
* SqsMessageListenerContainer<Object> defaultSqsListenerContainerFactory(SqsAsyncClient sqsAsyncClient) {
* return SqsMessageListenerContainerFactory
* .builder()
* .configure(options -> options
* .messagesPerPoll(5)
* .maxMessagesPerPoll(5)
* .pollTimeout(Duration.ofSeconds(10)))
* .sqsAsyncClient(sqsAsyncClient)
* .build()
* .create("myQueue");
* .createContainer("myQueue");
* }
* </code>
* </pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,37 @@
* manually and declared as beans will have their lifecycle managed by Spring Context.
* <p>
* Example using the builder:
*
*
* <pre>
* <code>
* &#064;Bean
* public SqsMessageListenerContainer<Object> mySqsListenerContainer(SqsAsyncClient sqsAsyncClient) {
* return SqsMessageListenerContainer
* .builder()
* .configure(options -> options
* .messagesPerPoll(5)
* .maxMessagesPerPoll(5)
* .pollTimeout(Duration.ofSeconds(10)))
* .sqsAsyncClient(sqsAsyncClient)
* .messageListener(System.out::println)
* .queueNames("myTestQueue")
* .build();
* }
* </code>
* </pre>
*
* <p>
* Example using the constructor:
*
*
* <pre>
* <code>
* &#064;Bean
* public SqsMessageListenerContainer<Object> myListenerContainer(SqsAsyncClient sqsAsyncClient) {
* SqsMessageListenerContainer<Object> container = new SqsMessageListenerContainer<>(sqsAsyncClient);
* container.configure(options -> options
* .messagesPerPoll(5)
* .maxMessagesPerPoll(5)
* .pollTimeout(Duration.ofSeconds(10)));
* container.setQueueNames("myTestQueue");
* container.setMessageListener(System.out::println);
* return container;
* }
* </code>
Expand Down

0 comments on commit 05db765

Please sign in to comment.