خرید بک لینک

Vote count: 0

I'm using the Redis component in my Camel application. One issue is that it automatically prepends strings to keys. For example, let's say I run the following in my Camel app:

        from("direct://path/to/store/in/redis")
            .setHeader(RedisConstants.COMMAND, constant("SET"))
            .setHeader(RedisConstants.KEY, constant("key"))
            .setHeader(RedisConstants.VALUE, constant("value"))
            .to(spring-redis://localhost:6379);

Then, if I open my command-line Redis client and run the following to list all keys in the DB:

> keys *

it retus:

1) "xacxedx00x05tx00x03key"

Here you can see that it prepended xacxedx00x05tx00x03 to the key, and I'm not sure where exactly it does that.

This wouldn't be a problem if I was only using the GET and SET Redis commands, because for some reason it prepends the same string to the key for these commands, so there's no key mis-match. However, if I try to perform a different Redis command, like KEYS, through the Camel app, like this:

from("direct://some/other/path/to/redis")
        .setHeader(RedisConstants.COMMAND, constant("KEYS"))
        .setHeader(RedisConstants.PATTERN, constant("*"))
        .to(spring-redis://localhost:6379);

it prepends a slightly different string to the asterisk, which results in the query not retuing anything because there are no matches to the patte. That is, the

> KEYS * 

command translates to something like the following in Redis:

> KEYS "xacxedx00x05tx00x05t*" 

Any thoughts on this?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 4 خرداد 1395 ساعت: 7:55

صفحه بندی