<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    paulwong

    #

    Maven打包時(shí),環(huán)境變量替換,并解決spring-boot項(xiàng)目中${}無效的問題

    https://www.jianshu.com/p/cf3bd9ddfe6f

    posted @ 2019-11-20 16:12 paulwong 閱讀(746) | 評(píng)論 (0)編輯 收藏

    LOGBACK FOR SPRING

    當(dāng)程序中使用LOGGER.INFO("MESSAGE");要求打印日志時(shí),LOGBACK會(huì)獲取該行代碼所在類的全名,和打印等級(jí)(INFO/DEBUG等),再在配置文件的<logger>中查找對(duì)應(yīng)logger,使用其配置的appender組件打印日志,如無法找到對(duì)應(yīng)的logger,則使用<root>對(duì)應(yīng)的appender打印日志。

    其中appender是用來輸出日志,有file和console兩個(gè)實(shí)現(xiàn),console則是向控制臺(tái)輸出日志,而file則是向文件輸出日志。
    rolling file appender中,有rollingPolicy和triggerPolicy兩個(gè)主要屬性,rollingPolicy是確定如何處理日志文件,而triggerPolicy則是確定何時(shí)處理日志文件。

    如果要使用SPRING針對(duì)LOGBACK的一些功能,如profile等,則要將logback.xml的配置文件命名為logback-spring.xml,并在SPRING中配置,logging.config= logback-spring.xml。

    SPRING會(huì)將logging.file、logging.path這些配置轉(zhuǎn)成系統(tǒng)變量LOG_FILE、LOG_PATH,可在配置文件中直接引用,如${LOG_FILE}。

    如果logback配置文件要SPRING的其他屬性,則要使用如下標(biāo)簽:
    <springProperty scope="context" name="logLevel" source="log.level"/>

    如果要使用LOGBACK的一些常用屬性,可引入:
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
    如CONSOLE APPENDER,此resource在spring-boot-version.jar中。


    =========================================
    看完這個(gè)不會(huì)配置 logback ,請(qǐng)你吃瓜!
    https://juejin.im/post/5b51f85c5188251af91a7525

    logback解析——Appender
    https://juejin.im/post/5a39c91cf265da4327185d10

    SpringBoot中l(wèi)ogback.xml使用application.yml中屬性
    https://www.cnblogs.com/jianliang-Wu/p/8945343.html

    springboot使用logback-spring.xml配置講解
    https://blog.csdn.net/heguiliang_123/article/details/80296745

    Logback配置
    https://www.cnblogs.com/cjsblog/p/9113131.html

    Logback中如何自定義靈活的日志過濾規(guī)則
    https://www.jianshu.com/p/d6360c517264

    Spring Boot中的日志
    http://loveshisong.cn/%E7%BC%96%E7%A8%8B%E6%8A%80%E6%9C%AF/2016-11-03-Spring-Boot%E4%B8%AD%E7%9A%84%E6%97%A5%E5%BF%97.html

    Spring Boot與logback總結(jié)
    https://blog.csdn.net/u014527058/article/details/79667458

    SpringBoot Logback 配置參數(shù)遷移到配置中心 Apollo
    https://blog.csdn.net/shuaizai88/article/details/83027262

    posted @ 2019-11-19 15:14 paulwong 閱讀(363) | 評(píng)論 (0)編輯 收藏

    MONGODB安裝


    https://www.jianshu.com/p/d3b31b7aa182 

    后續(xù)初始化用戶及數(shù)據(jù)庫(kù)
    http://www.qianduan8.com/1786.html
    https://zocada.com/setting-mongodb-users-beginners-guide/

    如果要以認(rèn)證的方式登錄,需加以下內(nèi)容至/etc/mongod.conf
    security:
      authorization: enabled

    如果用GUI連接數(shù)據(jù)庫(kù)時(shí),不顯示數(shù)據(jù)庫(kù)列表,要加權(quán)限:listDatabases
    https://stackoverflow.com/questions/19458524/mongodb-show-dbs-and-show-log-without-clusteradmin-role

    posted @ 2019-11-15 17:30 paulwong 閱讀(343) | 評(píng)論 (0)編輯 收藏

    Setting up ActiveMQ for HA-Load Balance


    In a typical enterprise applications, we often need messaging and asynchronous processing.
    To satisfy this need, we need a reliable as well as scalable messaging infrastructure. In currently available messaging infrastructures Apache ActiveMQ stands out in terms of features and simplicity.

    Apache ActiveMQ comes with lot of features in built and also provides a way to configure or tweak as per the needs of an application.

    In this post , we will explore how to enable network of activeMQ brokers so that we achieve HA(High Availability) as well as load balance between consumers & producers.

    I carried out  my experiment on local machine with ACtiveMQ 5.8.0, but this can be easily upgraded to latest versions of ActiveMQ viz. 5.10.0

    To have network of brokers, we need multiple brokers. So, I changed tcp and admin ports of brokers so that I can run multiple brokers on single machine.

    To get brief background on network of broker, please visit this link

    In this post we will setup below topology, we will mix failover and NOB to get work done,

    1. Producer1 is configured to send messages to broker3 with failover to broker2
    2. Producer2 is configured to send messages to broker2 with failover to broker3
    3. Broker3, Broker2 are networked with Broker1as below


    4. Broker1 is connected with broker4 with NOB.
    5. Make sure you enable "advisorySupport" on the broker, which is essential for transparent routing of messages across brokers.
    Dry Run:
    1. Producer1 sends messages to queue "input.q" on broker3, where there are no active consumers, but it see subscriptions from broker1
    2. Broker1 and broker 4 are has consumers which are looking at "input.q".
    3. When broker3 receives a message it forwards it to broker1, as its in networked and has active consumers for "input.q" 
    4. When broker1 receives a messages on "input.q", it gets load balanced between broker1 and broker4  as both has consumers looking for "input.q".
    5. Whenever broker3 goes down, producer1 switches transparently to broker2, as its configured with failover.
    6. I used prefetch size as 1, so that you can load balancing on consumers
    Sample activemq configurations can be downloaded from here.

    posted @ 2019-11-04 16:14 paulwong 閱讀(396) | 評(píng)論 (0)編輯 收藏

    ACTIVE MQ HA

    組建ACTIVEMQ CLUSTER,使得其中一個(gè)ACTIVE MQ DOWN掉時(shí),能自動(dòng)切換到其他節(jié)點(diǎn)。

    ACTIVEMQ 只有MASTER-SLAVE模式,集群中的多個(gè)節(jié)點(diǎn)共享消息的存儲(chǔ),多個(gè)節(jié)點(diǎn)同時(shí)啟動(dòng)時(shí),競(jìng)爭(zhēng)消息存儲(chǔ)的鎖,誰先取得,誰就是MASTER,當(dāng)MASTER DOWN掉時(shí),鎖被釋放,SALVE中馬上又競(jìng)爭(zhēng)鎖,取得者成為MASTER。

    方案:
    • 安裝NFSV4
    • 修改消息存儲(chǔ)路徑
      <persistenceAdapter>
        <kahaDB directory="/sharedFileSystem/sharedBrokerData"/>
      </persistenceAdapter>
    • 客戶端修改連接字符串
      failover://(tcp://master:61616,tcp://slave:61616)?randomize=false
    --》


    https://my.oschina.net/hzchenyh/blog/716424

    https://www.iteye.com/blog/shift-alt-ctrl-2069250

    https://stackoverflow.com/questions/53542928/activemq-ha-on-failover

    https://activemq.apache.org/shared-file-system-master-slave

    ActiveMQ(6)-基于networkConnector的Broker-Cluster方案
    https://blog.csdn.net/jinjin603/article/details/78657387


    Multi Data Centre Message Brokers with ActiveMQ
    https://medium.com/thg-tech-blog/multi-data-centre-message-brokers-with-activemq-28495046370e

    ActiveMQ中的NetworkConnector(網(wǎng)絡(luò)連接器)詳解
    https://www.iteye.com/blog/manzhizhen-2116920

    a

    posted @ 2019-11-01 10:46 paulwong 閱讀(397) | 評(píng)論 (0)編輯 收藏

    ACTIVEMQ設(shè)置預(yù)取消息數(shù)目

    當(dāng)ACTIVEMQ的某個(gè)QUEUE有多個(gè)消費(fèi)者,為避免某個(gè)消息者取了更多個(gè)消息處理,而造成其他消費(fèi)者無消息可處理的情況,可以設(shè)置每個(gè)消費(fèi)者不預(yù)取消息,即每個(gè)消費(fèi)者消費(fèi)完單個(gè)消息后,再去取消息,這樣其他消費(fèi)者就能平均的有消息可處理。


    https://stackoverflow.com/questions/35928089/activemq-how-to-prevent-message-from-going-to-dispatched-queue


    設(shè)置方法,在CONNECT STRING中設(shè)置:
    tcp://localhost:61616?jms.prefetchPolicy.all=0 

    tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=0 

    queue = new ActiveMQQueue("TEST.QUEUE?consumer.prefetchSize=10"); 
    consumer = session.createConsumer(queue);

    http://activemq.apache.org/what-is-the-prefetch-limit-for.html

    posted @ 2019-10-31 11:28 paulwong 閱讀(834) | 評(píng)論 (0)編輯 收藏

    EIP in SPRING INTEGRATION

    • idempotent receiver
    冪等型,同一個(gè)MESSAGE,如MESSAGE ID都一樣,在MESSAGING系統(tǒng)中不管運(yùn)行多少次,結(jié)果都一樣,為啥?因?yàn)橹貜?fù)的MESSAGE,都被忽略了。
    方案:
    消息被處理后,從消息中取出ID,放入META-DATA-STORE中,后續(xù)處理消息時(shí),要從META-DATA-STORE中檢查是否有值。

    下面這個(gè)方案,ID的存儲(chǔ)和判斷是否重復(fù)消息都在一個(gè)INTERCEPTOR中搞定。
    https://stackoverflow.com/questions/50401460/spring-integration-dsl-configure-idempotent-receiver-to-identify-duplicates
    https://www.javacodegeeks.com/2015/09/monitoring-and-management.html


    claim-check
    將MESSAGE的PAYLOAD存在STORE中,返回一個(gè)ID,這個(gè)ID即claim-check,如果需要取MESSAGE的DETAIl時(shí),可從STORE中取出MESSAGE。
    https://github.com/spring-projects/spring-integration/blob/master/src/reference/asciidoc/claim-check.adoc


    posted @ 2019-10-25 11:03 paulwong 閱讀(492) | 評(píng)論 (0)編輯 收藏

    SPRING INTEGRATION LESSONS

    Lessons

    Introduction to Enterprise Application Integration

    In our first lesson, you will get introduced to the concepts of Enterprise Application Integration. You will learn about the and Enterprise integration patterns that can be applied to simplify integration between different platforms and the Integration strategies that can be followed for this purpose. Finally, we will discuss how and why to implement a Message driven architecture and how to achieve both Synchronous and asynchronous communication among nodes.

    Spring Integration Fundamentals

    In this lesson, you will get to understand how Spring Integration works under the hood. The core concepts of Spring Integration messaging system (like message channels and endpoints) will be introduced. Additionally, the components that build the framework will be discussed, including the channel adapters, transformers, filters, routers etc. Finally, the two distinct methods of communication (synchronous and asynchronous) are explained and the lesson ends with a discussion on error handling.

    Spring Integration and Web Services

    In this lesson, we will focus on the integration with external web services. Spring Integration comes with the necessary functionality (adapters, channels etc.) to support web services out of the box. A full example is built from scratch in order to better understand the topic.

    Enterprise Messaging

    In this lesson, we will focus on integrating our application with JMS messaging. For this purpose, we will use Active MQ, which will be our broker. We will show examples of sending and receiving JMS messages by using the Spring Integration JMS channel adapters. Following these examples, we will see some ways of customizing these invocations by configuring message conversion and destination resolution.

    Spring Integration Full Example

    In this lesson, we will wrap everything up by providing a complete application that uses several of the components provided by Spring Integration in order to provide a service to its users. We will discuss the system architecture, the actual implementation and the relevant error handling.

    Monitoring and Management

    In this lesson, we will examine different mechanisms of monitoring or gathering more information about what is going on within the messaging system. Some of these mechanisms consist of managing or monitoring the application through MBeans, which are part of the JMX specification. Another mechanism discussed in this chapter is how we will implement the EIP idempotent receiver pattern using a metadata store. Finally, the last mechanism described is the control bus. This will let us send messages that will invoke operations on components in the application context.

    posted @ 2019-10-25 09:45 paulwong 閱讀(312) | 評(píng)論 (0)編輯 收藏

    SPRING INTEGRATION DSL DEMO

    https://github.com/spring-projects/spring-integration/tree/master/src/reference/asciidoc

    posted @ 2019-10-23 11:55 paulwong 閱讀(333) | 評(píng)論 (0)編輯 收藏

    Spring Integration 中文手冊(cè) - GOOD

    Spring Integration 中文手冊(cè) (1)


    Spring Integration 中文手冊(cè) (2)

    posted @ 2019-10-11 10:28 paulwong 閱讀(834) | 評(píng)論 (0)編輯 收藏

    僅列出標(biāo)題
    共115頁: First 上一頁 22 23 24 25 26 27 28 29 30 下一頁 Last 
    主站蜘蛛池模板: 美女被免费网站视频在线| 亚洲一级片免费看| 亚洲精品美女久久久久| 美女被免费网站91色| 亚洲av无码专区在线观看素人| 亚洲AV无码一区二区三区牲色 | 国产亚洲精品拍拍拍拍拍| 色欲aⅴ亚洲情无码AV蜜桃| 成年女人免费v片| 亚洲人成无码网站在线观看 | 国产精品亚洲а∨无码播放不卡 | 亚洲国产精品美女| 97在线线免费观看视频在线观看| 亚洲成av人片不卡无码| 免费国产作爱视频网站| 亚洲日本天堂在线| vvvv99日韩精品亚洲| 久久久精品视频免费观看 | 毛片A级毛片免费播放| 亚洲日韩一中文字暮| 国产精品酒店视频免费看| 黄色一级视频免费观看| 亚洲夜夜欢A∨一区二区三区| 久久免费视频观看| 亚洲va精品中文字幕| 国产在线19禁免费观看国产| 中文字幕免费人成乱码中国| 亚洲国产成人精品不卡青青草原| 91免费播放人人爽人人快乐| 色欲aⅴ亚洲情无码AV蜜桃| 中文字幕第13亚洲另类| 久久WWW免费人成一看片| 亚洲av乱码中文一区二区三区| 国产精品亚洲产品一区二区三区 | 亚洲男女一区二区三区| 韩国免费三片在线视频| 中文精品人人永久免费| 亚洲avav天堂av在线网爱情| 亚洲色偷偷狠狠综合网| 亚洲免费观看在线视频| xxxxx做受大片视频免费|