锘??xml version="1.0" encoding="utf-8" standalone="yes"?>奇米色欧美一区二区三区,99久久精品免费看国产一区二区三区,国产视频久久久久久久http://www.aygfsteel.com/paulwong/category/55385.htmlzh-cnTue, 23 Nov 2021 14:41:59 GMTTue, 23 Nov 2021 14:41:59 GMT60SPRING REACTOR 涔婩lux鍜孧onohttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436063.htmlpaulwongpaulwongTue, 23 Nov 2021 06:30:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436063.htmlhttp://www.aygfsteel.com/paulwong/comments/436063.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436063.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436063.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436063.htmlSPRING REACTOR 涔婩lux鍜孧ono錛屾湁鐐硅薄SPRING INTEGRATION鐨処ntegrationFlow錛屾湁濡備笅鐗圭偣
  • 瀹氫箟浜嗛拡瀵規(guī)煇縐嶇被鍨嬫暟鎹殑澶勭悊嫻佺▼
  • 鍙互榪涜綾誨瀷杞崲
  • 闀挎湡榪愯錛岄櫎闈炶瑕佹眰涓
  • 嫻佺▼涓殑姣忕鎿嶄綔鍙互鍦ㄦ柊鐨勭嚎紼嬩腑鎵ц
  • 鍙互姝e父涓錛屽鏋滀腑閫旀湁寮傚父錛屽垯璇ユ祦紼嬩篃浼?xì)涓?/li>
  • 瑕乻ubscribe錛屾祦紼嬫墠寮濮嬭鍚姩
  • 鍙互鍒嗗壊鎴愬悇涓瓙嫻佺▼
  • 鍙互鑱氬悎瀛愭祦紼?/li>
  • Mono鍙戦佷竴涓暟鎹紝灝卞彂閫佷腑姝俊鍙?/li>
  • Flux鍙戦佷換鎰忔暟鎹紝鐢辯▼搴忓喅瀹氫綍鏃跺彂閫佷腑姝俊鍙?/li>

緙栫▼鍒欐瘮杈冪畝鍗曪紝鍏堟牴鎹笉鍚岀殑鏁版嵁綾誨瀷瀹氫箟涓嶅悓鐨凢lux鎴朚ono錛屼笟鍔℃搷浣滅敤Function鍖呰鍚庯紝鏀懼湪map/flatmap涓紝鍐嶈皟鐢╯ubscribe鍚姩嫻佺▼銆?/div>

paulwong 2021-11-23 14:30 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM - @PollableBean for Reactive Suppliershttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436060.htmlpaulwongpaulwongTue, 23 Nov 2021 02:03:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436060.htmlhttp://www.aygfsteel.com/paulwong/comments/436060.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436060.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436060.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436060.htmlSupplier beans, or functions that only publish messages in Spring Cloud Stream, are a bit special in that they aren't triggered by the receiving of events like Function or Consumer beans. This means that you often need a way to trigger them to be executed periodically.

For imperative functions the framework by default "polls" a Supplier function every 1 second, but that duration is configurable using the spring.cloud.stream.poller.fixed-delay property.

However, for reactive functions supplying a Flux it is only triggered once by default. This is because a Flux itself is potentially an infinite stream of events so in many cases it will only need to be triggered once. But don't worry, if you want to periodically trigger a reactive Supplier because you are producing a finite stream of events you can still do so using @PollableBean. This annotation then allows you to configure how often the function is triggered using the same spring.cloud.stream.poller.fixed-delay property!

One example use case here could be periodically querying a data store and publishing each entry/row as an event. The number of rows in your data store is a finite number at any given time.

Example code:

@PollableBean 
public Supplier<Flux<String>> stringSupplier() { return () -> Flux.just("foo","bar","baz"); }


Reference:
https://solace.community/discussion/360/pollablebean-for-reactive-suppliers-in-spring-cloud-stream

paulwong 2021-11-23 10:03 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM - 浠庨潪SCS緇勪歡鍙戦佹秷鎭埌SCS緇勪歡http://www.aygfsteel.com/paulwong/archive/2021/11/19/436054.htmlpaulwongpaulwongFri, 19 Nov 2021 03:47:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/19/436054.htmlhttp://www.aygfsteel.com/paulwong/comments/436054.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/19/436054.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436054.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436054.html
閭d箞鍦⊿PRING CLOUD STREAM涓紝濡傛灉瑕佷粠闈濻PRING CLOUD STREAM浠g爜鍙戦丮ESSAGE鍒癝PRING CLOUD STREAM紼嬪簭錛岄氬父灝辮鍏堥氱煡妗嗘灦鑷姩鐢熸垚涓涓猄OURCE銆?br />
application.property
spring.cloud.stream.source=supplier
spring.cloud.stream.bindings.supplier-out-0.destination=notification-events

java
streamBridge.send("supplier-out-0", userDto);

Reference:
https://blog.devgenius.io/event-driven-microservices-with-spring-cloud-stream-e034eee3f394


paulwong 2021-11-19 11:47 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM - Error Handlinghttp://www.aygfsteel.com/paulwong/archive/2021/11/17/436052.htmlpaulwongpaulwongWed, 17 Nov 2021 02:50:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/17/436052.htmlhttp://www.aygfsteel.com/paulwong/comments/436052.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/17/436052.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436052.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436052.html
@ServiceActivator(inputChannel = "my-destination.my-group.errors")
    public void handleError(ErrorMessage message) {
        Throwable throwable = message.getPayload();
        log.error("鎴幏寮傚父", throwable);

        Message<?> originalMessage = message.getOriginalMessage();
        assert originalMessage != null;

        log.info("鍘熷娑堟伅浣?nbsp;= {}", new String((byte[]) originalMessage.getPayload()));
    }

璇︽儏鍙傝冿細(xì)
https://www.itmuch.com/spring-cloud/spring-cloud-stream-error-handling/

paulwong 2021-11-17 10:50 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM - Function Componenthttp://www.aygfsteel.com/paulwong/archive/2021/11/15/436051.htmlpaulwongpaulwongMon, 15 Nov 2021 09:40:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/15/436051.htmlhttp://www.aygfsteel.com/paulwong/comments/436051.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/15/436051.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436051.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436051.html
緇勪歡鍦板潃錛?br />https://github.com/spring-cloud/stream-applications/tree/main/functions

鐗規(guī)畩緇勪歡錛屽皢FUNCTION鍙樻垚HTTP ENDPOINTS錛?br />https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-starter-function-web
https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-starter-function-webflux



paulwong 2021-11-15 17:40 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM 3.x - Functional Programming Modelhttp://www.aygfsteel.com/paulwong/archive/2021/11/10/436035.htmlpaulwongpaulwongWed, 10 Nov 2021 07:10:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/10/436035.htmlhttp://www.aygfsteel.com/paulwong/comments/436035.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/10/436035.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436035.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436035.htmlSPRING CLOUD STREAM 3.x 鐗堟湰鏃訛紝涔嬪墠鐨勪竴浜涚紪紼嬫ā寮忥紝濡侤Enablebindding錛孈StreamListenner絳夋敞閲婅搴熷純浜嗭紝榪欐槸鐢變簬涓浜涙鏋剁殑浠g爜蹇呴渶鐢辯敤鎴風(fēng)紪鍐欙紝濡傞厤緗鏋剁敤鐨処nput MessageChannel錛孫utput  MessageChannel錛岃繛鎺essageHandler涓嶮essageChannel絳夛紝琚涓轟笉蹇呰鐨勫姩浣溿備負(fù)浜嗙畝鍖栫敤鎴蜂唬鐮侊紝浜庢槸鎺ㄥ嚭Functional Programming Model銆?br />
寮曞叆浜嗘柊鍚嶈瘝錛歋upplier銆丗unction涓嶤onsumer銆傚疄闄呬笂榪欏嚑涓被鍙涓篈dapter錛屽鏋滀箣鍓嶅凡緇忔湁瀛樺湪鐨凷ervice綾伙紝涓旀柟娉曞悕涓哄悇縐嶅悇鏍鳳紝鍙互閲嶆柊鍖呰鎴怱upplier銆丗unction涓嶤onsumer錛屽茍鍦ㄥ浐瀹氱殑鏂規(guī)硶鍚嶏細(xì)apply/get/accept涓皟鐢⊿ervice鐨勬柟娉曘?br />

Supplier

褰撳湪閰嶇疆鏂囦歡涓敞鍏ユ綾誨瀷鐨凚ean錛屽茍鍦╯pring.cloud.stream.function.definition鍔犲叆姝ean鐨勫悕縐幫紝SPRING CLOUD STREAM灝變細(xì)甯綘鐢熸垚涓涓狾utput  MessageChannel錛屽茍榪炴帴涓婃Bean錛屽悗緇彧闇瑕佸湪BINDDING涓姞鍏ュ搴旂殑Destination Name錛屽嵆鍙悜B(tài)ROKER鍙戞秷鎭簡銆?br />

Consumer

褰撳湪閰嶇疆鏂囦歡涓敞鍏ユ綾誨瀷鐨凚ean錛屽茍鍦╯pring.cloud.stream.function.definition鍔犲叆姝ean鐨勫悕縐幫紝SPRING CLOUD STREAM灝變細(xì)甯綘鐢熸垚涓涓狪nput  MessageChannel錛屽茍榪炴帴涓婃Bean錛屽悗緇彧闇瑕佸湪BINDDING涓姞鍏ュ搴旂殑Destination Name錛屽嵆鍙敹鍒癇ROKER鎺ㄩ佸叧浜庢Destination鐨勬秷鎭簡銆?br />

Function

褰撳湪閰嶇疆鏂囦歡涓敞鍏ユ綾誨瀷鐨凚ean錛屽茍鍦╯pring.cloud.stream.function.definition鍔犲叆姝ean鐨勫悕縐幫紝SPRING CLOUD STREAM灝變細(xì)甯綘鐢熸垚涓涓狪nput鍜孫utput  MessageChannel錛屽茍榪炴帴涓婃Bean錛屽悗緇彧闇瑕佸湪BINDDING涓垎鍒Input鍜孫utput MessageChannel鍔犲叆瀵瑰簲鐨凞estination Name1/Name2錛屽嵆鍙敹鍒癇ROKER鎺ㄩ佸叧浜庢Destination鐨勬秷鎭紝涔熷彲浠ュ悜B(tài)ROKER鍙戞秷鎭簡銆?br />

涓嶴PRING INTEGRATION鐨勬暣鍚?/h2>濡傛灉瑕佸娑堟伅榪涜澶嶆潅澶勭悊錛屽鎷嗗垎娑堟伅銆佽仛鍚堟秷鎭両F ELSE娑堟伅絳夛紝灝辮鍊熷姪SPRING INTEGRATION浜嗐?br />
@Bean
    public IntegrationFlow upperCaseFlow(LoanService loanService) {
        return IntegrationFlows
                    //turn this IntegrationFlow as a gateway, here is a Function interface 
                    
//with loadCheckerFunction as bean name
                    .from(LoadCheckerFunction.class, gateway -> gateway.beanName("loadCheckerFunction"))
                    .handle(loanService, "check")
                    .logAndReply(LoggingHandler.Level.WARN);
    }

    public interface LoadCheckerFunction extends Function<Loan, Loan>{

    }

IntegrationFlows.from(Class<?> serviceInterface)鏄彲浠ュ皢鏈琁ntegrationFlow鍖呰鎴恠erviceInterface鐨勫疄鐜扮被錛屽鏋滆皟鐢ㄦ鎺ュ彛錛屾渶緇堜細(xì)榪斿洖IntegrationFlow鏈鍚庝竴涓楠ょ殑瀹炰綋錛屽鏋滆繖涓猻erviceInterface鏄疐unction鐨勮瘽錛屽垰濂藉拰SPRING CLOUD STREAM瀵規(guī)帴涓娿?br />
鍚庣畫鍦╯pring.cloud.stream.function.definition鍔犲叆姝ean鐨勫悕縐發(fā)oadCheckerFunction錛孲PRING CLOUD STREAM灝變細(xì)甯綘鐢熸垚涓涓狪nput鍜孫utput  MessageChannel錛屽茍榪炴帴涓婃Bean錛屽啀鍦˙INDDING涓垎鍒Input鍜孫utput MessageChannel鍔犲叆瀵瑰簲鐨凞estination Name1/Name2錛屽嵆鍙敹鍒癇ROKER鎺ㄩ佸叧浜庢Destination鐨勬秷鎭紝涔熷彲浠ュ悜B(tài)ROKER鍙戞秷鎭?br />
application.yaml
# This setting can increase or decrease the rate of message production (1000 = 1s)
# spring.cloud.stream.poller.fixed-delay=1000

# This setting can control which function method in our code will be triggered if there are multiple
# spring.cloud.function.definition=supplyLoan

# Give the autogenerated binding a friendlier name

spring:
   application:
      name: loan-check-rabbit
   banner:
      location: classpath:/banner-rabbit.txt
   cloud:
      stream:
         function.definition: loadCheckerFunction
         #BindingProperties
         bindings:
            loadCheckerFunction-in-0:
               destination: queue.pretty.log.messages
               binder: local_rabbit
            loadCheckerFunction-out-0:
               destination: queue.pretty.approved.messages
               binder: local_rabbit
         #BinderProperties
         binders:
            local_rabbit:
               type: rabbit
               environment:
                  spring:
                     rabbitmq:
                        host: 10.80.27.69
                        port: 5672
                        username: guest
                        password: guest
                        virtual-host: my-virtual-host

Reference

https://spring.io/blog/2019/10/25/spring-cloud-stream-and-spring-integration

paulwong 2021-11-10 15:10 鍙戣〃璇勮
]]>
EVEN DRIVEN - SPRING CLOUD STREAM - SPRING CLOUD寰湇鍔$殑EVEN DRIVEN妗嗘灦http://www.aygfsteel.com/paulwong/archive/2021/11/05/436031.htmlpaulwongpaulwongFri, 05 Nov 2021 06:58:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/05/436031.htmlhttp://www.aygfsteel.com/paulwong/comments/436031.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/05/436031.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436031.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436031.html
鍗矨寰湇鍔″簲鐢ㄥ皢鏁版嵁鍙戦佸埌MESSAGE BROKER涓殑鏌愪釜DESTINATION錛屾DESTINATION鏄箍鎾瀷錛岄潪鐐瑰鐐瑰瀷銆侭寰湇鍔″簲鐢ㄨ闃呮DESTINATION錛屽綋鏈夋柊MESSAGE鍒拌揪姝ESTINATION鏃訛紝MESSAGE BROKER浼?xì)灏嗘MESSAGE鎺ㄩ佺粰B搴旂敤銆傛墍鏈夊姝ESSAGE鏈夐渶瑕佺殑搴旂敤鍧囧彲璁㈤槄錛屼粠鑰屾敹鍒版MESSAGE銆?br />
SPRING CLOUD 涓璄VENT DRIVEN鐨勬鏋跺氨鏄疭PRING CLOUD STREAM銆傚叾搴曞眰鏄嬌鐢⊿PRING INTEGRATION瀹炵幇銆?br />
SPRING CLOUD STREAM鏈変互涓嬫柊鍚嶈瘝錛?br />
  • BINDER錛?/li>
鏄MESSAGE BROKER鎿嶄綔鏂規(guī)硶鐨勬娊璞★紝鍗沖簲鐢ㄩ氳繃姝INDER鎿嶄綔MESSAGE BROKER銆傜洰鍓嶅彧瀹炵幇浜哛ABITMQ鍜孠AFKA銆?br />
  • CHANNEL
MESSAGE浠嶴PRING CLOUD STREAM浼犵粰搴旂敤鎴栫浉鍙嶆槸閫氳繃CHANNEL浼犻掔殑錛岃繖鐐瑰拰SPRING INTEGRATION鏄竴鏍風(fēng)殑銆?br />
  • SOURCE
MESSAGE浠庡簲鐢ㄤ紶緇橲PRING CLOUD STREAM鐨凜HANNEL錛屽彨@INPUT錛屽寘鍚繖縐岰HANNEL鐨勬帴鍙e彨SOURCE銆?br />
  • SINK
MESSAGE浠嶴PRING CLOUD STREAM浼犵粰搴旂敤鐨凜HANNEL錛屽彨@OUPUT錛屽寘鍚繖縐岰HANNEL鐨勬帴鍙e彨SINK銆?br />
  • BIDDING
緇戝畾鍝釜@INPUT鎴栧摢涓狜OUPUT涓庡摢涓狣ESTINATION鍙戦佹垨鎺ユ敹鍏崇郴鐨凪APPING銆?br />
  • EnableBinding
搴旂敤鍚姩鏃跺氨浼?xì)寰忕珛EnableBinding鎸囧畾鐨勬帴鍙d腑鐨凜HANNEL
  • 娑堣垂鑰呯兢緇?/li>
榛樿涓嬪鏋滃悓涓涓簲鐢ㄩ儴緗蹭簡澶氫釜瀹炰緥錛屽垯姣忎釜瀹炰緥閮戒細(xì)鏀跺埌MESSAGE錛岃繖鏃跺鏋滆緗簡娑堣垂鑰呯兢緇勫悕縐幫紝鍒欏悓涓涓悕縐頒笅鐨勫涓疄渚嬶紝鍙湁涓涓兘鏀跺埌MESSAGE銆?br />
  • PARTITION
濡傛灉涓篗ESSAGE鎸囧畾瑙勫垯錛屽MESSAGE鏌愪釜瀛楁鍊間互A寮澶翠負(fù)涓涓鍒欙紝浠寮澶翠負(fù)涓涓鍒欙紝閭d箞浠寮澶寸殑MESSAGE浼?xì)鏀惧埌鍚屼竴涓垎鍖轟腑銆?br />
榪欐牱浣跨敤灝卞緢綆鍗曚簡錛屽彧瑕佸彇寰桹UTPUT CHANNEL錛屽氨鍙互鍙戦丮ESSAGE錛屽皢浠g爜鍏寵仈鍒癐NPUT CHANNEL錛屽氨鑳藉湪鏀跺埌MESSAGE鏃訛紝鐩稿叧浠g爜灝變細(xì)琚墽琛屻?br />


paulwong 2021-11-05 14:58 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 宁阳县| 江华| 克拉玛依市| 朔州市| 顺义区| 甘德县| 济源市| 含山县| 卓尼县| 井冈山市| 西吉县| 平远县| 尼玛县| 凤台县| 龙海市| 韩城市| 商南县| 古浪县| 禄丰县| 云林县| 陇南市| 通渭县| 阿尔山市| 峡江县| 卢龙县| 聂荣县| 安阳市| 旌德县| 邯郸县| 潮州市| 黄山市| 崇信县| 江陵县| 新闻| 淅川县| 永胜县| 丰台区| 丽水市| 皮山县| 宁河县| 金山区|