update package

pull/248/head
weihu 3 years ago
parent 0b9bca77a7
commit ffc4f6a4d5

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
package cn.hippo4j.springboot.starter.adapter.rabbitmq.example; package cn.hippo4j.springboot.starter.adapter.rabbitmq.example.config;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;

@ -15,12 +15,12 @@
* limitations under the License. * limitations under the License.
*/ */
package cn.hippo4j.springboot.starter.adapter.rabbitmq.example; package cn.hippo4j.springboot.starter.adapter.rabbitmq.example.constants;
/** /**
* Simple MQ constant. * Simple MQ constant.
*/ */
public class SimpleMQConstant { public interface SimpleMQConstant {
public static final String QUEUE_NAME = "framework_message-center_queue"; String QUEUE_NAME = "framework_message-center_queue";
} }

@ -15,9 +15,10 @@
* limitations under the License. * limitations under the License.
*/ */
package cn.hippo4j.springboot.starter.adapter.rabbitmq.example; package cn.hippo4j.springboot.starter.adapter.rabbitmq.example.consumer;
import cn.hippo4j.example.core.dto.SendMessageDTO; import cn.hippo4j.example.core.dto.SendMessageDTO;
import cn.hippo4j.springboot.starter.adapter.rabbitmq.example.constants.SimpleMQConstant;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -31,7 +32,7 @@ import org.springframework.stereotype.Component;
*/ */
@Slf4j @Slf4j
@Component @Component
public class MessageConsume { public class MessageConsumer {
@RabbitHandler @RabbitHandler
@RabbitListener(queuesToDeclare = @Queue(SimpleMQConstant.QUEUE_NAME), containerFactory = "defaultRabbitListenerContainerFactory") @RabbitListener(queuesToDeclare = @Queue(SimpleMQConstant.QUEUE_NAME), containerFactory = "defaultRabbitListenerContainerFactory")

@ -15,9 +15,10 @@
* limitations under the License. * limitations under the License.
*/ */
package cn.hippo4j.springboot.starter.adapter.rabbitmq.example; package cn.hippo4j.springboot.starter.adapter.rabbitmq.example.producer;
import cn.hippo4j.example.core.dto.SendMessageDTO; import cn.hippo4j.example.core.dto.SendMessageDTO;
import cn.hippo4j.springboot.starter.adapter.rabbitmq.example.constants.SimpleMQConstant;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
Loading…
Cancel
Save