{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/1425","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/1425/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/1425/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/1425/events","html_url":"https://github.com/spring-cloud/spring-cloud-stream/issues/1425","id":344985218,"node_id":"MDU6SXNzdWUzNDQ5ODUyMTg=","number":1425,"title":"MessageChannel should specify whether it is an inbound or outbound channel","user":{"login":"ngbalk","id":5477368,"node_id":"MDQ6VXNlcjU0NzczNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/5477368?v=4","gravatar_id":"","url":"https://api.github.com/users/ngbalk","html_url":"https://github.com/ngbalk","followers_url":"https://api.github.com/users/ngbalk/followers","following_url":"https://api.github.com/users/ngbalk/following{/other_user}","gists_url":"https://api.github.com/users/ngbalk/gists{/gist_id}","starred_url":"https://api.github.com/users/ngbalk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngbalk/subscriptions","organizations_url":"https://api.github.com/users/ngbalk/orgs","repos_url":"https://api.github.com/users/ngbalk/repos","events_url":"https://api.github.com/users/ngbalk/events{/privacy}","received_events_url":"https://api.github.com/users/ngbalk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"olegz","id":172397,"node_id":"MDQ6VXNlcjE3MjM5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/172397?v=4","gravatar_id":"","url":"https://api.github.com/users/olegz","html_url":"https://github.com/olegz","followers_url":"https://api.github.com/users/olegz/followers","following_url":"https://api.github.com/users/olegz/following{/other_user}","gists_url":"https://api.github.com/users/olegz/gists{/gist_id}","starred_url":"https://api.github.com/users/olegz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegz/subscriptions","organizations_url":"https://api.github.com/users/olegz/orgs","repos_url":"https://api.github.com/users/olegz/repos","events_url":"https://api.github.com/users/olegz/events{/privacy}","received_events_url":"https://api.github.com/users/olegz/received_events","type":"User","site_admin":false},"assignees":[{"login":"olegz","id":172397,"node_id":"MDQ6VXNlcjE3MjM5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/172397?v=4","gravatar_id":"","url":"https://api.github.com/users/olegz","html_url":"https://github.com/olegz","followers_url":"https://api.github.com/users/olegz/followers","following_url":"https://api.github.com/users/olegz/following{/other_user}","gists_url":"https://api.github.com/users/olegz/gists{/gist_id}","starred_url":"https://api.github.com/users/olegz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegz/subscriptions","organizations_url":"https://api.github.com/users/olegz/orgs","repos_url":"https://api.github.com/users/olegz/repos","events_url":"https://api.github.com/users/olegz/events{/privacy}","received_events_url":"https://api.github.com/users/olegz/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/milestones/48","html_url":"https://github.com/spring-cloud/spring-cloud-stream/milestone/48","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/milestones/48/labels","id":3677430,"node_id":"MDk6TWlsZXN0b25lMzY3NzQzMA==","number":48,"title":"2.1.0.RC1","description":"","creator":{"login":"olegz","id":172397,"node_id":"MDQ6VXNlcjE3MjM5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/172397?v=4","gravatar_id":"","url":"https://api.github.com/users/olegz","html_url":"https://github.com/olegz","followers_url":"https://api.github.com/users/olegz/followers","following_url":"https://api.github.com/users/olegz/following{/other_user}","gists_url":"https://api.github.com/users/olegz/gists{/gist_id}","starred_url":"https://api.github.com/users/olegz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegz/subscriptions","organizations_url":"https://api.github.com/users/olegz/orgs","repos_url":"https://api.github.com/users/olegz/repos","events_url":"https://api.github.com/users/olegz/events{/privacy}","received_events_url":"https://api.github.com/users/olegz/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":7,"state":"open","created_at":"2018-09-21T10:09:16Z","updated_at":"2018-10-23T10:08:31Z","due_on":"2018-10-24T07:00:00Z","closed_at":null},"comments":1,"created_at":"2018-07-26T20:00:51Z","updated_at":"2018-10-23T10:09:56Z","closed_at":"2018-10-23T10:08:31Z","author_association":"NONE","body":"Copying from:\r\nhttps://github.com/spring-projects/spring-integration/issues/2525\r\n\r\nI've noticed that when I'm using Spring Cloud Streams (take the Sink.class and Source.class for example), both MessageChannels \"output\" and \"input\" are created as DirectChannels.\r\n\r\n```java\r\npublic interface Sink {\r\n\r\n\tString INPUT = \"input\";\r\n\r\n\t@Input(Sink.INPUT)\r\n\tSubscribableChannel input();\r\n\r\n}\r\n```\r\n```java\r\npublic interface Source {\r\n\r\n\tString OUTPUT = \"output\";\r\n\r\n\t@Output(Source.OUTPUT)\r\n\tMessageChannel output();\r\n\r\n}\r\n```\r\n\r\nI actually have no way of knowing whether this DirectChannel is an output or an input (besides looking at the bean name, but I wouldn't want to rely on that).\r\n\r\nIt would be helpful for me, especially when using a `@GlobalChannelInterceptor`, to know whether a MessageChannel is an input or output (i.e. annotated with `@Input` or `@Output`).  That way, in a `ChannelInterceptor.preSend()` I could do some checking of whether this is an inbound message or an outbound message and apply logic accordingly.\r\n\r\nCurious to hear what people think / maybe I'm missing something obvious.\r\n\r\nNOTE: I raised this on DirectChannel because I see that it applies to both inbound and outbound channels, and other channels are more specific to either inbound or outbound.  However perhaps this makes sense in another class too...\r\n\r\nThanks\r\nNick"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/comments/432185303","html_url":"https://github.com/spring-cloud/spring-cloud-stream/issues/1425#issuecomment-432185303","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-stream/issues/1425","id":432185303,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjE4NTMwMw==","user":{"login":"olegz","id":172397,"node_id":"MDQ6VXNlcjE3MjM5Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/172397?v=4","gravatar_id":"","url":"https://api.github.com/users/olegz","html_url":"https://github.com/olegz","followers_url":"https://api.github.com/users/olegz/followers","following_url":"https://api.github.com/users/olegz/following{/other_user}","gists_url":"https://api.github.com/users/olegz/gists{/gist_id}","starred_url":"https://api.github.com/users/olegz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegz/subscriptions","organizations_url":"https://api.github.com/users/olegz/orgs","repos_url":"https://api.github.com/users/olegz/repos","events_url":"https://api.github.com/users/olegz/events{/privacy}","received_events_url":"https://api.github.com/users/olegz/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T10:09:56Z","updated_at":"2018-10-23T10:09:56Z","author_association":"CONTRIBUTOR","body":"You can now test if the channel is `DirectWithAttributesChannel` and if it is, then you can look at the attributes as such:\r\n```\r\nDirectWithAttributesChannel inputChannel = (DirectWithAttributesChannel) testSink.input();\r\nDirectWithAttributesChannel outputChannel = (DirectWithAttributesChannel) testSource.output();\r\nassertThat(inputChannel.getAttribute(\"type\")).isEqualTo(Sink.INPUT);\r\nassertThat(outputChannel.getAttribute(\"type\")).isEqualTo(Source.OUTPUT);\r\n```"}}
{"actor":{"display_login":"olegz"}}