简体   繁体   中英

Send a message from slack user to another slack user with apache camel

how to configure a spring boot project to Send a message from slack user to another slack user with apache camel?

here is the code need to be configured:

public class SlackRouter extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        String WEB_HOOK_ROUTE = "https://hooks.slack.com/services/XXXXXXXX/YYYYYYYYYY/ZZZZZZZZZZZZZZZ";

        from("direct:testSlack")).to("slack:@slack-user?webhookUrl="+WEB_HOOK_ROUTE);

    }
}

You can use the username property for configuring your producer.

For example:

public class SlackRouter extends RouteBuilder {

@Override
public void configure() throws Exception {

    String WEB_HOOK_ROUTE = "https://hooks.slack.com/services/XXXXXXXX/YYYYYYYYYY/ZZZZZZZZZZZZZZZ";

    from("direct:testSlack")).to("slack:@slack-user?username=MYUSERNAME&webhookUrl="+WEB_HOOK_ROUTE);

}

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM