spring-integration-kafka annotation support & example - spring

Although new to spring, I'm usually able to get started with a spring projects fairly well with annotations only. The official examples uses xml without mentioning where they will be placed etc.
Is there any sample project on reading from a kafka topic? Preferably by using annotation to set the zk & kafka configuration properties.

Please, take a look to the Spring Integration Java DSL project and here is a KafkaTests to demonstrate how to be for your case.
Plus here you are Josh Long's article: https://spring.io/blog/2015/04/15/using-apache-kafka-for-integration-and-data-processing-pipelines-with-spring

Related

Spring Batch Java annotated - restart example

Using the Spring Boot, Batch example: https://spring.io/guides/gs/batch-processing/
Project is now running, but the site doesn't go into how to write Unit tests around this structure. Github examples for Spring Batch show xml examples, which do not seem to correlate to this boot style.
Has anyone ran into any good Spring Boot, Batch examples that show restarting, unit testing, etc
The reference documentation was recently updated to provide java based configuration examples for every example in the doc. You can check out our testing page and see the java examples here: https://docs.spring.io/spring-batch/4.0.x/reference/html/testing.html#testing

What is meant by Spring boot follows “Opinionated Defaults Configuration” Approach?

I have just started learning spring boot . In its official page I found out this term and I did not understand that what actually it meant in Spring boot context.
Spring Boot just decides on a set of default configured beans which you can override if you want.
For example if you include the spring boot starter pom for jpa, you'll get autoconfigured for you an in memory database, a hibernate entity manager, and a simple datasource. This is an example of an opinionated (Spring's opinion that it's a good starting point) default configuration that you can override.
See https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-replacing-auto-configuration
Spring Boot, is Spring on steroids if you will. It's a great way to get started very quickly with almost the entire Spring stack. I'll try to summarize as what "Opinionated Defaults Configuration" would mean in practice from a programmer's perspective below:
Helps you to setup a fully working application(web app or otherwise) very quickly by providing you intelligent default configurations that you are most likely to be satisfied to start with.
It does so by something called "AutoConfiguration", where capabilities from the Spring ecosystem of products are "auto-magically" enabled in your application by adding certain dependencies to your classpath; adding such dependencies via maven or gradle is super easy.
Most auto-configuration respects your own configuration, and backs off silently if you have provided your own configuration via your own beans.
You would benefit most if you take the java config approach of configuring your Spring application.
Super silky integration of new capabilities in your application by developing your own auto-configuration components (via annotations!).
Tons of auto-configaration components available ranging from Databases(h2, derby etc.), servlet containers(tomact, jetty etc.) to email and websockets are available. It is easy to develop your own. The important thing is that others can use those technology enablements in their own components. Please feel free to contribute.
Helps write very clean code with all the heavy lifting taken care of you, so that you can focus more on your business logic.
Hope you have fun with Spring Boot; its absolutely among the very best of frameworks to have hit the market in the last decade or so.
It follows opinionated default configuration so it reduces the developer efforts. Spring boot always uses sensible opinions, mostly based on the class path contents. So it overrides the default configuration.

Spring Integration (not Basic Spring) support for Drools

Do we have examples or out of box support to use Spring Integration(not Basic Spring) as opposed to Camel with Drools like in link here?
What I would looking for is a way to build/set-up Decision Tables
and be able to use Spring Integration framework already existing in my application.
I have read about Spring but what I am looking for is Integration Framework support - specifically Spring-Integration as opposed to Apache Camel
Any pointers for basic set-up appreciated.
I think would be better if I move my comment to the answer to close this question:
I'd say that you should use that Drools-Camel fusion and route the result to the Spring Integration MessageChannel http://camel.apache.org/springintegration.html. Spring Integration doesn't support directly Drools and there is no plans.
The main reason - "do not reinvent the wheel".
Since Drools lives in JBOSS very well and has that Camel integration, there is no reason to find alternative solution.
Right, it's not a position of Spring Integration developer, but we just don't want to start a new holy war "Camel VS Spring Integration" :-).

DWR 3 integration in Spring 3 environment without XML

I started a new Spring project without any XML configuration file. I become a big fan of annotation config. So I tried to include DWR library, which I used in my last projects. But I cannot find any tutorial, how to integrate DWR 3 in an java config spring environment.
Is this already possible, or can somebody recommend another solution where I dont have to use XML configuration files?
You can follow below two links.
Sample codes are also in the link
http://krams915.blogspot.com/2011/01/spring-mvc-3-and-dwr-3-integration.html
Spring 3 MVC integration with DWR with Annotation

Spring configuration using Java annotations

I have started working on an inventory management system (web application) using Spring Framework 3.1.1** and would like to configure Spring Framework using Java annotations. I searched Google, but I could not find a suitable example showing how to configure Spring Framework using Java annotations in a web application. Where is there a proper example or tutorial?
Spring Framework references are comprehensive. Refer to the Spring reference material, 3.11 Java-based container configuration.
Another option to consider is to use Java based configuration. It is more readable, and is easier than annotations.
Spring Documentation
Simple Example using Java based configuration

Resources