|
@@ -1,10 +1,14 @@
|
|
|
package com.pj;
|
|
|
|
|
|
+import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
|
|
+import org.springframework.amqp.support.converter.MessageConverter;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.context.ApplicationPidFileWriter;
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
|
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.retry.annotation.EnableRetry;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
|
@@ -21,7 +25,8 @@ import java.util.Properties;
|
|
|
@EnableScheduling
|
|
|
@SpringBootApplication
|
|
|
@EnableTransactionManagement
|
|
|
-@EnableFeignClients
|
|
|
+@EnableFeignClients
|
|
|
+@EnableRetry
|
|
|
public class LevelOneServer {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
@@ -33,4 +38,13 @@ public class LevelOneServer {
|
|
|
SpCloudUtil.printCurrentServiceInfo();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 消息转换器
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Bean
|
|
|
+ public MessageConverter messageConverter(){
|
|
|
+ return new Jackson2JsonMessageConverter();
|
|
|
+ }
|
|
|
+
|
|
|
}
|