小编Nag*_*ngh的帖子

SpringBoot + RabbitMQ 抛出错误:java.net.ConnectException:连接被拒绝

我在 heroku 上托管了一个多模块项目,并在尝试运行我的 Spring Boot 应用程序时收到以下错误。

2018-06-13T05:34:47.611296+00:00 app[web.1]: 2018-06-13 05:34:47.611  INFO 4 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Bean with name 'rabbitConnectionFactory' has been autodetected for JMX exposure
2018-06-13T05:34:47.617422+00:00 app[web.1]: 2018-06-13 05:34:47.617  INFO 4 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Located managed bean 'rabbitConnectionFactory': registering with JMX server as MBean [org.springframework.amqp.rabbit.connection:name=rabbitConnectionFactory,type=CachingConnectionFactory]
2018-06-13T05:34:47.646470+00:00 app[web.1]: 2018-06-13 05:34:47.646  INFO 4 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 2147483647
2018-06-13T05:34:47.660578+00:00 app[web.1]: 2018-06-13 05:34:47.660  INFO 4 --- [    container-1] o.s.a.r.c.CachingConnectionFactory       : Attempting to connect to: …
Run Code Online (Sandbox Code Playgroud)

java yaml rabbitmq spring-boot

5
推荐指数
1
解决办法
9853
查看次数

EventSourcePolyfill 与原生 EventSource(性能方面)

我看到一个库允许使用HeaderEventSource 自定义标头。

事件源Polyfill

但是,当我看到网络选项卡时,Type显示的fetch不是 ,eventsource 而如果我使用本机,EventSource它会生成类型为eventsource

fetch和之间的性能有区别吗eventsource

使用 Polyfill

const eventSourceInitDict = {headers: {
        'ClientId': '123123123',
        'ClientSecret': 'lllasjdlkasjdlkasdlka'
    }};
const objEventSource1 = new EventSourcePolyfill('https://*****.herokuapp.com/emit-custom-pe?userId=' + '{!$User.Id}', eventSourceInitDict);
objEventSource1.addEventListener('message', function (objEventSourceData) {
    debugger;
});
Run Code Online (Sandbox Code Playgroud)

使用本机事件源

const objEventSource1 = new EventSource('https://****.herokuapp.com/emit-custom-pe?userId=' + '{!$User.Id}');
objEventSource1.addEventListener('message', function (objEventSourceData) {
    debugger;
});
Run Code Online (Sandbox Code Playgroud)

javascript performance server-sent-events eventsource

5
推荐指数
0
解决办法
1625
查看次数