davidmoten / rxjava2-jdbc

RxJava2 integration with JDBC including Non-blocking Connection Pools
Apache License 2.0
392 stars 42 forks source link

springboot2 webflux(2.1.2)+rxjava2-jdbc nodata #40

Open feesx opened 5 years ago

feesx commented 5 years ago

@Configuration public class RxJava2JdbcConfig { /**

public Flux getAllAdverts3() { String sql = "SELECT name,code FROM company"; return Flux.from(db.select(sql).autoMap(Company.class)); }

@Query("select name, code from company") public interface Company { @Column("name") String name();

@Column("code") 
String code();

}

result :

[ {} ] but mysql have data

davidmoten commented 5 years ago

Did you check for an error emission from the Flux?

davidmoten commented 5 years ago

Instead of using spring have you tried to connect to the database directly using rxjava2-jdbc?