Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Annotations Helloworld #221

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

lunkdjedi
Copy link

Refactored the helloworld integration-samples to be completely annotation based.

@pivotal-issuemaster
Copy link

@lunkdjedi Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@lunkdjedi Thank you for signing the Contributor License Agreement!

Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, consider to move this project to the dsl directory.

Also you need really to add a Gladle project to the build.gradle

Anyway thank you very much for the contribution!


@Configuration
@EnableIntegration
@IntegrationComponentScan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this annotation. There is no any @MessagingGateway in your application


@Bean
public IntegrationFlow helloFlow(final HelloService helloService) {
return IntegrationFlows.from(inputChannel()).handle(new GenericHandler<String>() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, consider to use method chain style, when each call is on its own line starting with period.

Also, consider to use lambda instead of the GenericHandler.

@@ -0,0 +1,33 @@
/*
* Copyright 2002-2012 the original author or authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new class, so only the current year in the Copyright.
All classes must have the Copyright, BTW.

/**
* Simple POJO to be referenced from a Service Activator.
*
* @author Mark Fisher
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your class, not Mark's.

As well as for all other your classes, please.

*/
@SuppressWarnings("resource")
public static void main(String[] args) throws Exception{
new AnnotationConfigApplicationContext(PollerConfig.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is pollable app we really can't just use context.close(); in the end.
So, consider to include to the code this:

System.in.read();
context.close();

* demonstrated below.
* <p>
* View the configuration of the channels and the endpoint (a &lt;service-activator/&gt;
* element) in 'helloWorldDemo.xml' within this same package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somehow not related to the current state of the code.
I mean you claim like it is about annotations and DSL configuration, but still point to the XML config in JavaDocs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants