锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久激情视频,伊人色**天天综合婷婷,成人自拍视频在线http://www.aygfsteel.com/paulwong/category/55384.htmlzh-cnThu, 02 Dec 2021 09:38:22 GMTThu, 02 Dec 2021 09:38:22 GMT60SPRING CLOUD - REACTIVE FEIGNhttp://www.aygfsteel.com/paulwong/archive/2021/12/01/436078.htmlpaulwongpaulwongWed, 01 Dec 2021 08:45:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/12/01/436078.htmlhttp://www.aygfsteel.com/paulwong/comments/436078.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/12/01/436078.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436078.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436078.html
pom.xml
<dependency>
    <groupId>com.playtika.reactivefeign</groupId>
    <artifactId>feign-reactor-spring-cloud-starter</artifactId>
    <version>3.1.2</version>
    <type>pom</type>
</dependency>


LoanDecisionClientReactive.java
package com.paul.testspringcloudstream.loancheck.service;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.paul.testspringcloudstream.common.model.Loan;

import reactivefeign.spring.config.ReactiveFeignClient;
import reactor.core.publisher.Mono;

@ReactiveFeignClient(name = "loan-decision")
public interface LoanDecisionClientReactive {
    
    @PostMapping("/loan-decision")
    public Mono<Loan> getDecision(@RequestBody Loan loan);

}

LoanCheckConfiguration.java
@Configuration
@Import({
    MongoDbConsumerConfiguration.class,
})
@EnableDiscoveryClient
@EnableReactiveFeignClients("com.paul.testspringcloudstream.loancheck.service")
public class LoanCheckConfiguration {
}


浣跨敤鍚宖eign
@Autowired
private LoanDecisionClientReactive loanDecisionClientReactive;

Reference
https://blog.csdn.net/LCBUSHIHAHA/article/details/113817966

瀹樻柟SAMPLE
https://github.com/kptfh/feign-reactive-sample

paulwong 2021-12-01 16:45 鍙戣〃璇勮
]]>
SPRING 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錛屾湁濡備笅鐗圭偣
  • 瀹氫箟浜嗛拡瀵規煇縐嶇被鍨嬫暟鎹殑澶勭悊嫻佺▼
  • 鍙互榪涜綾誨瀷杞崲
  • 闀挎湡榪愯錛岄櫎闈炶瑕佹眰涓
  • 嫻佺▼涓殑姣忕鎿嶄綔鍙互鍦ㄦ柊鐨勭嚎紼嬩腑鎵ц
  • 鍙互姝e父涓錛屽鏋滀腑閫旀湁寮傚父錛屽垯璇ユ祦紼嬩篃浼氫腑姝?/li>
  • 瑕乻ubscribe錛屾祦紼嬫墠寮濮嬭鍚姩
  • 鍙互鍒嗗壊鎴愬悇涓瓙嫻佺▼
  • 鍙互鑱氬悎瀛愭祦紼?/li>
  • Mono鍙戦佷竴涓暟鎹紝灝卞彂閫佷腑姝俊鍙?/li>
  • Flux鍙戦佷換鎰忔暟鎹紝鐢辯▼搴忓喅瀹氫綍鏃跺彂閫佷腑姝俊鍙?/li>

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

paulwong 2021-11-23 14:30 鍙戣〃璇勮
]]>
SPRING REACTOR 浣跨敤鏍蜂緥http://www.aygfsteel.com/paulwong/archive/2021/11/23/436062.htmlpaulwongpaulwongTue, 23 Nov 2021 05:59:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436062.htmlhttp://www.aygfsteel.com/paulwong/comments/436062.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436062.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436062.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436062.html
package com.paul.testreactivestream.reactor;


import java.util.List;

import org.junit.jupiter.api.Test;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;

public class SpringReactorTest {
    
    private void subscribeAndEnd(Flux<?> flux) {
        
        flux.map(c -> String.format("[%s] %s", Thread.currentThread().getName(), c))
            .subscribe(System.out::println);
        
        flux.blockLast();
    }
    
    @Test
    public void createAFlux_just() throws InterruptedException {
        Flux<String> fruitFlux = 
                Flux.just("Apple", "Orange", "Grape", "Banana", "Strawberry")
                    .log()
                    ;
        fruitFlux.subscribe(
                     f -> System.out.println(
                                 String.format("[%s] Here's some fruit: %s", Thread.currentThread().getName(), f)
                             )
                  )
                 ;
        fruitFlux.blockLast();
        
//        Thread.currentThread().join();
    }
    
    @Test
    public void zipFluxesToObject() {
        Flux<String> characterFlux = 
                Flux.just("Garfield", "Kojak", "Barbossa");
        
        Flux<String> foodFlux = 
                Flux.just("Lasagna", "Lollipops", "Apples");
        
        Flux<String> zippedFlux = 
                Flux.zip(characterFlux, foodFlux, (c, f) -> c + " eats " + f);
        
        this.subscribeAndEnd(zippedFlux);
    }
    
    @Test
    public void map() {
        Flux<Player> playerFlux = 
                Flux.just("Michael Jordan", "Scottie Pippen", "Steve Kerr")
                    .map(n -> {
                        String[] split = n.split("\\s");
                        return new Player(split[0], split[1]);
                    })
                    ;
        this.subscribeAndEnd(playerFlux);
    }
    
    @Test
    public void flatMap() {
        Flux<Player> playerFlux = 
                Flux.just("Michael Jordan", "Scottie Pippen", "Steve Kerr")
                    .flatMap(
                        n -> Mono.just(n)
                                 .map(p -> {
                                    String[] split = p.split("\\s");
                                    return new Player(split[0], split[1]);
                                  })
                                 .subscribeOn(Schedulers.parallel())
                     );
        this.subscribeAndEnd(playerFlux);
    }
    
    @Test
    public void buffer() {
        Flux<List<String>> fruitFlux = 
                Flux.just(
                        "apple", "orange", "banana", "kiwi", "strawberry"
                     )
                    .buffer(3);
        this.subscribeAndEnd(fruitFlux);
    }
    
    @Test
    public void bufferAsyn() {
        Flux<String> flux =
            Flux.just(
                    "apple", "orange", "banana", "kiwi", "strawberry"
                 )
                .buffer(3)
                .flatMap(x ->
                    Flux.fromIterable(x)
                        .map(y -> y.toUpperCase())
                        .subscribeOn(Schedulers.parallel())
    //                    .log()
                 );
        this.subscribeAndEnd(flux);
    }
    
    @Test
    public void all() {
        Mono<Boolean> animalFlux = 
                Flux.just(
                        "aardvark", "elephant", "koala", "eagle", "kangaroo"
                     )
                    .all(c -> c.contains("a"))
                    ;
        animalFlux.map(c -> String.format("[%s] %s", Thread.currentThread().getName(), c))
                  .subscribe(System.out::println);
    
    }

}


paulwong 2021-11-23 13:59 鍙戣〃璇勮
]]>
SPRING REACTOR璧勬簮http://www.aygfsteel.com/paulwong/archive/2021/11/23/436061.htmlpaulwongpaulwongTue, 23 Nov 2021 05:51:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436061.htmlhttp://www.aygfsteel.com/paulwong/comments/436061.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/11/23/436061.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/436061.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/436061.htmlhttps://www.jianshu.com/p/7ee89f70dfe5

Project Reactor 鏍稿績鍘熺悊瑙f瀽
https://www.jianshu.com/p/df395eb28f69

Project Reactor 涔?publishOn 涓?subscribeOn
https://www.jianshu.com/p/769f6e9824fb

Spring鍝嶅簲寮忕紪紼?br />https://blog.csdn.net/get_set/category_7484996.html











paulwong 2021-11-23 13:51 鍙戣〃璇勮
]]>
Java 9 Flow API 瀛︿範http://www.aygfsteel.com/paulwong/archive/2021/09/02/435963.htmlpaulwongpaulwongThu, 02 Sep 2021 07:39:00 GMThttp://www.aygfsteel.com/paulwong/archive/2021/09/02/435963.htmlhttp://www.aygfsteel.com/paulwong/comments/435963.htmlhttp://www.aygfsteel.com/paulwong/archive/2021/09/02/435963.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/435963.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/435963.htmlhttps://mrbird.cc/Java-9-Flow-API-Learn.html

paulwong 2021-09-02 15:39 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 长白| 肥西县| 花莲市| 秦皇岛市| 荥经县| 从江县| 德保县| 昂仁县| 芦溪县| 南平市| 文安县| 临桂县| 元江| 泰兴市| 陇南市| 德兴市| 兴义市| 石林| 乐清市| 南昌市| 巴林左旗| 新乡县| 北海市| 瑞丽市| 尼勒克县| 凤阳县| 长宁区| 临海市| 黔南| 嘉峪关市| 禄丰县| 阿拉善右旗| 泰宁县| 库尔勒市| 高州市| 微博| 临夏县| 当涂县| 灵山县| 子洲县| 繁峙县|