Skip to content

Revise new NullChannel() usage in favor of nullChannel bean #3067

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

Closed
artembilan opened this issue Sep 27, 2019 · 4 comments · Fixed by #3068
Closed

Revise new NullChannel() usage in favor of nullChannel bean #3067

artembilan opened this issue Sep 27, 2019 · 4 comments · Fixed by #3068
Assignees
Milestone

Comments

@artembilan
Copy link
Member

The problem with a new NullChannel() that we won't get a consistent metrics on the nullChannel bean.

Also consider to change successTimer in the NullChannel into the sendCounter since we don't care about timing on the nullChannel, but rather how many messages have been discarded.

@garyrussell garyrussell self-assigned this Sep 27, 2019
@garyrussell garyrussell added this to the 5.2.GA milestone Sep 27, 2019
@garyrussell
Copy link
Contributor

We can't change the meter type without adding special code to the graph server.

@artembilan
Copy link
Member Author

OK. I think we can live with 0-timer then. I hope it shows some throughput statistics anyway...

@garyrussell
Copy link
Contributor

garyrussell commented Sep 27, 2019

I only see these...

$ find . -name "*.java" | grep -v 'src/test' | xargs grep 'new NullChannel'
./spring-integration-file/src/main/java/org/springframework/integration/file/dsl/TailAdapterSpec.java:			this.factoryBean.setOutputChannel(new NullChannel());
./spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java:	private volatile MessageChannel beforeCommitChannel = new NullChannel();
./spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java:	private volatile MessageChannel afterCommitChannel = new NullChannel();
./spring-integration-core/src/main/java/org/springframework/integration/transaction/ExpressionEvaluatingTransactionSynchronizationProcessor.java:	private volatile MessageChannel afterRollbackChannel = new NullChannel();
./spring-integration-core/src/main/java/org/springframework/integration/aggregator/AbstractCorrelatingMessageHandler.java:	this.discardChannel = new NullChannel();

I suppose it was the aggregator where you saw problems?

@artembilan
Copy link
Member Author

We can fix a Spec: the MessageProducerSupport has setOutputChannelName(). Of course, we would need to fix a FileTailInboundChannelAdapterFactoryBean as well, but it is not clear to me why would TailAdapterSpec worry about that NullChannel at all...

Yes, an AbstractCorrelatingMessageHandler is an origin of this issue, but I don't think we should leave all others as is.
Although I would say ExpressionEvaluatingTransactionSynchronizationProcessor should just deal with null value for those channels instead of polluting a NullChannel...

garyrussell added a commit to garyrussell/spring-integration that referenced this issue Sep 27, 2019
garyrussell added a commit to garyrussell/spring-integration that referenced this issue Sep 27, 2019
artembilan pushed a commit that referenced this issue Sep 27, 2019
Resolves #3067

Also add missing receive counter.

* Late binding of null discard channel; checkstyle

* Fix test; fall back to new NullChannel(); always evaluate tx expressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants