Skip to content

add spring integration#9

Open
Bael wants to merge 1 commit into
masterfrom
spring_integration
Open

add spring integration#9
Bael wants to merge 1 commit into
masterfrom
spring_integration

Conversation

@Bael
Copy link
Copy Markdown
Owner

@Bael Bael commented Nov 25, 2018

Домашнее задание #15, интеграция спринга.
Перевел контроллер досок на интеграцию.

@Bean
public IntegrationFlow getBoards(BoardRepository boardRepository) {
return f -> f
.<String, Boolean>route(s -> s != null && s.length() > 0,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Класс!

public interface BoardMessagingGateway {

@Gateway(requestChannel = "createBoard.input")
BoardDTO createBoard(Message<BoardDTO> message);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Здесь не совсем правильно :) В смысле так можно, но гораздо лучше будет не оборачивать все в Message и писать например просто BoardDTO dto. Spring integration сам вместо нас обернет все в Message, но зато у нас вызывающая часть приложения будет вообще ничего не знать про Spring integration, и мы сможем свободно подменять реализации.

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.

2 participants