## Release notes:
- `
+```
+
commit 4b507b15b0122ac180e44b8418db8d9143ae9c3a
Author: Kai Moritz
Date: Tue Jan 15 23:09:01 2013 +0100
Author: Kai Moritz
Date: Thu Nov 29 18:23:59 2012 +0100
Found annotated classes get logged now
-`
+```
## Release notes:
- `
+```
+
commit 4edef457d2b747d939a141de24bec5e32abbc0c7
Author: Kai Moritz
Date: Fri Aug 2 00:37:40 2013 +0200
Integration of the maven-plugin-plugin for automated helpmojo-generation
Thanks to Adriano Machado, who contributed this patch!
-`
+```
## Release notes:
- `
+```
+
commit adb20bc4da63d4cec663ca68648db0f808e3d181
Author: Kai Moritz
Date: Fri Oct 18 01:52:27 2013 +0200
Best regards,
Eduard
-`
+```
## Release notes:
- `
+```
+
commit f3dabc0e6e3676244986b5bbffdb67d427c8383c
Author: Kai Moritz
Date: Mon Jun 2 10:31:12 2014 +0200
Author: Kai Moritz
Date: Fri Oct 18 01:55:11 2013 +0200
[maven-release-plugin] prepare for next development iteration
-`
+```
## Release notes:
- `
+```
+
commit ec30af2068f2d12a9acf65474ca1a4cdc1aa7122
Author: Kai Moritz
Date: Tue Nov 11 15:28:12 2014 +0100
Author: Kai Moritz
Date: Mon Jun 2 10:31:13 2014 +0200
[maven-release-plugin] prepare for next development iteration
-`
+```
## Release notes:
- `
+```
+
commit 94e6b2e93fe107e75c9d20aa1eb3126e78a5ed0a
Author: Kai Moritz
Date: Sat May 16 14:14:44 2015 +0200
Added support for m2e
Thanks to Andreas Khutz
-`
+```
Resending the messages in correct order after a failure (or downtime) is no problem.
But some of the messages may be send twice (or more often), because the producer does not know exactly, which messages were send successful.
-`Incident A - { id: 1, data: "ab583cc8f8" }
+```
+Incident A - { id: 1, data: "ab583cc8f8" }
Incident B - { id: 2, data: "83ccc8f8f8" }
Incident C - { id: 3, data: "115tab5b58" }
Incident C - { id: 4, data: "83caac564b" }
Incident B - { id: 9, data: "7583ab93ab" }
Incident C - { id: 10, data: "7583aab583" }
Incident B - { id: 11, data: "b583075830" }
-`
+```
Since eache message has a unique ID, all messages are inherently idempotent:
**Deduplication is no problem, if the receiver keeps track of the messages, he has already seen.**
In this simplified setup, the implementation effectively boils down to the following method-override:
-`@Override
+```
+@Override
public Iterable<String> transform(String value)
{
Integer partition = context.partition();
}
return Collections.emptyList();
}
-`
+```
- We can get the active partition from the `ProcessorContext`, that is handed to our Instance in the constructor, which is not shown here for brevity.
- Parsing the `String`-value of the message as `long` corresponds to the extraction of the sequence number from the value of the message in our simplified setup.
We can use our `ValueTransformer` with **`flatTransformValues()`**,
to let Kafka Streams drop the detected duplicate values:
-`streamsBuilder
+```
+streamsBuilder
.stream("input")
.flatTransformValues(
new ValueTransformerSupplier()
},
"SequenceNumbers")
.to("output");
-`
+```
One has to register an appropriate store to the `StreamsBuilder` under the referenced name.
Additionally Beans can be added programatically very easy with the help of an `ApplicationContextInitializer`:
-`@AllArgsConstructor
+```
+@AllArgsConstructor
public class MultipleBeansApplicationContextInitializer
implements
ApplicationContextInitializer
}
}
}
-`
+```
This simplified example is configured with a list of strings that should be registered as controllers with the `DispatcherServlet`.
All "sites" are insances of the same controller `SiteController`, which are instanciated and registered dynamically.
If you write an **`EnvironmentPostProcessor`**, you will get access to an instance of `ConfigurableEnvironment`, that contains a complete list of all `PropertySource`'s, that are configured for your Spring-Boot-App.
-`public class MultipleBeansEnvironmentPostProcessor
+```
+public class MultipleBeansEnvironmentPostProcessor
implements
EnvironmentPostProcessor
{
.toArray(size -> new String[size])));
}
}
-`
+```
**The Bad News:**
Unfortunately, you have to scan all property-sources for the parameters, that you are interested in.
Finally, you have to [register](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-the-environment-or-application-context "Read more on details and/or alternatives of the mechanism") the `EnvironmentPostProcessor` with your Spring-Boot-App.
This is done in the **`META-INF/spring.factories`**:
-`org.springframework.boot.env.EnvironmentPostProcessor=\
+```
+org.springframework.boot.env.EnvironmentPostProcessor=\
de.juplo.demos.multiplebeans.MultipleBeansEnvironmentPostProcessor
-`
+```
**That's it, your done!**
Consider the following controller, that defines a request-handling and an accompanying exception-handler, for an
`IllegalArgumentException`, that may by thrown in the business-logic:
-`@Controller
+```
+@Controller
public class ExampleController
{
@Autowired