Rabbitmq 在项目中的使用

项目中要用mq,为了保证最终一致性;但是demo里面消费没有问题,放到项目里面总是报错

Caused by: java.lang.IllegalStateException: The mapped handler method class 'com.tfjybj.intern.provider.service.impl.SenderServiceImpl$$EnhancerBySpringCGLIB$$7277e23b' is not an instance of the actual endpoint bean class 'com.tfjybj.intern.provider.service.impl.SenderServiceImpl$$EnhancerBySpringCGLIB$$ab569431'. If the endpoint requires proxying (e.g. due to @Transactional), please use class-based proxying.
HandlerMethod details: 
Endpoint [com.tfjybj.intern.provider.service.impl.SenderServiceImpl]
Method [public final void com.tfjybj.intern.provider.service.impl.SenderServiceImpl$$EnhancerBySpringCGLIB$$7277e23b.receive0(org.springframework.amqp.core.Message,com.rabbitmq.client.Channel) throws java.io.IOException]
Resolved arguments: 
[0] [type=org.springframework.amqp.core.Message] [value=(Body:'{"processDefinitionId":null,"processDefinitionKey":"intern-recruit-1.2","message":null,"businessKey":"1135743530518454279","variables":null,"tenantId":null,"returnVariables":false}' MessageProperties [headers={spring_listener_return_correlation=e1dcd58e-f693-44da-b39f-4050ba48b001, __TypeId__=com.dmsdbj.activiti.qo.ProcessInstanceCreateRequest}, contentType=application/json, contentEncoding=UTF-8, contentLength=0, receivedDeliveryMode=PERSISTENT, priority=0, redelivered=true, receivedExchange=RECRUIT_EXCHANGE, receivedRoutingKey=recruit, deliveryTag=1, consumerTag=amq.ctag-nDzPAKCOjVhkezn-bMtsRA, consumerQueue=RECRUIT_QUEUE])]
[1] [type=com.sun.proxy.$Proxy280] [value=Cached Rabbit Channel: PublisherCallbackChannelImpl: AMQChannel(amqp://[email protected]:5672/,1), conn: Proxy@37c887f7 Shared Rabbit Connection: SimpleConnection@2b2e5df7 [delegate=amqp://[email protected]:5672/, localPort= 27889]]

	at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.assertTargetBean(InvocableHandlerMethod.java:222)
	at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:184)
	at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:114)
	at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:51)
	at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:182)
	... 10 common frames omitted

你可能感兴趣的:(mq)