我正在使用 spring redisTemplate 和 redis 扫描
它可以在单节点的情况下查找。
但在集群环境下就不行了
我无法获取数据。
有没有办法在集群环境中获取扫描数据?
这是我的 spring redisTemplate 代码。
//String key="products:aa";
//String key="products:aac";
//String key="products:ab";
//String key="products:ac";
String workKey="products:aa*";
ScanOptions options = ScanOptions.scanOptions().match(workKey).count(100).build();
ScanOptions options1 = ScanOptions.scanOptions().build();
RedisConnectionFactory factory = redisTemplate.getConnectionFactory();
RedisConnection conn = factory.getConnection();
Cursor<byte[]> cursor = conn.scan(options);
List<Product> result = new ArrayList<Product>();
while(cursor.hasNext()){
String key=new String((byte[]) cursor.next());
Product pa=getById(key.replace("products:",""));
result.add(pa);
}
//result
//String key="products:aa";
//String key="products:aac";
Run Code Online (Sandbox Code Playgroud) 你好~我正在使用camel http组件。我无法提取正文信息。
\n\n这是我的代码
\n\n.log(LoggingLevel.INFO, "ToUri ===> ${body}")\n.toD("${body}")\n.log(LoggingLevel.INFO, "Result ===> ${body}")\n.process(new Processor() {\n\n\n public void process(Exchange exchange) throws Exception {\n\n long startTime = System.currentTimeMillis();\n Message inboundMessage = exchange.getIn();\n\n\n Object body = exchange.getIn().getBody();\n String msg = inboundMessage.getBody(String.class);\n\n System.out.println("body:"+body);\n System.out.println("getInBody msg:"+msg);\n System.out.println("getInBody body:"+body.toString());\n ======================================================================= \nbody : org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream@28936ba4\ngetInBody msg:\ngetInBody bodybodybody:org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream@28936ba4\nRun Code Online (Sandbox Code Playgroud)\n\n日志是好作品。像这样
\n\n09:56:53.523 INFO route1 - ToUri ===> https://translation.googleapis.com/language/translate/v2?key=tesetKey&source=en&target=ja&q=hi\n09:56:54.545 INFO route1 - Result ===> {\n "data": {\n "translations": [\n {\n "translatedText": "\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1\xe3\x81\xaf"\n }\n ]\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n\n我想使用骆驼提取翻译文本。
\n\n我如何处理 CachedOutputStream 这是什么? …
我正在使用 Flutter 并想使用 parser.dart 解析 HTML
<div class="weather-item now"><!-- now -->
<span class="time">Now</span>
<div class="temp">19.8<span>?</span>
<small>(23?)</small>
</div>
<table>
<tr>
<th><i class="icon01" aria-label="true"></i></th>
<td>93%</td>
</tr>
<tr>
<th><i class="icon02" aria-label="true"></i></th>
<td>south 2.2km/h</td>
</tr>
<tr>
<th><i class="icon03" aria-label="true"></i></th>
<td>-</td>
</tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
使用,导入 'package:html/parser.dart';
我想得到这个数据
现在,19.8,23,93%,南 2.2km/h
我怎样才能做到这一点?
apache-camel ×1
camel-http ×1
flutter ×1
flutter-http ×1
flutter-web ×1
redis ×1
spring-data ×1