package com.megatim.apifdxweb.service.impl.camel.routes.in;
|
|
import com.megatim.apifdxweb.service.impl.camel.consumers.UserActionLogConsumer;
|
import com.megatim.apifdxweb.tools.AppContext;
|
import com.megatim.fdxcommons.model.log.UserActionLog;
|
import com.megatim.fdxcommons.tools.resolvers.JacksonMapperFormat;
|
import javax.enterprise.context.ApplicationScoped;
|
import org.apache.camel.builder.RouteBuilder;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
@ApplicationScoped
|
public class UserActionsRoute extends RouteBuilder {
|
|
@Override
|
public void configure() throws Exception {
|
|
from("direct:" + AppContext.API_USER_ACTION_DIRECT)
|
.marshal(JacksonMapperFormat.jacksonDataFormat(UserActionLog.class))
|
.to("rabbitmq:"
|
+ AppContext.API_USER_ACTION_EXCHANGE
|
+ "?queue=" + AppContext.API_USER_ACTION_QUEUE
|
+ "&routingKey=" + AppContext.API_USER_ACTION_ROUTING_KEY
|
+ "&autoDelete=false");
|
|
from("rabbitmq:"
|
+ AppContext.API_USER_ACTION_EXCHANGE
|
+ "?queue=" + AppContext.API_USER_ACTION_QUEUE
|
+ "&routingKey=" + AppContext.API_USER_ACTION_ROUTING_KEY
|
+ "&autoDelete=false")
|
.unmarshal(JacksonMapperFormat.jacksonDataFormat(UserActionLog.class))
|
.bean(UserActionLogConsumer.class);
|
|
from("direct:" + com.megatim.fdxcommons.tools.context.AppContext.USER_ACTION_TO_FDX_CONS_DIRECT)
|
.marshal(JacksonMapperFormat.jacksonDataFormat(UserActionLog.class))
|
.to("rabbitmq:"
|
+ com.megatim.fdxcommons.tools.context.AppContext.USER_ACTION_TO_FDX_CONS_EXCHANGE
|
+ "?queue=" + com.megatim.fdxcommons.tools.context.AppContext.USER_ACTION_TO_FDX_CONS_QUEUE
|
+ "&routingKey=" + com.megatim.fdxcommons.tools.context.AppContext.USER_ACTION_TO_FDX_CONS_ROUTING_KEY
|
+ "&autoDelete=false");
|
|
}
|
}
|