首页 \ 问答 \ 有没有办法确定redis键是否包含列表或集合?(Is there a way to determine if a redis key contains a list or a set?)

有没有办法确定redis键是否包含列表或集合?(Is there a way to determine if a redis key contains a list or a set?)

在确定redis数据库中的密钥列表之后,有没有办法确定特定密钥(仅给出名称)是列表还是集合?

我正在使用Ruby redis gem 2.1.1


After determining the list of keys in a redis database, is there any way to determine if a particular key (given only the name) is a list or a set?

I am using the Ruby redis gem 2.1.1


原文:https://stackoverflow.com/questions/6116779
更新时间:2022-05-19 07:05

最满意答案

BlockingQueueConsumer不能直接使用; 它是SimpleMessageListenerContainer一个组件,它将在消息被侦听器使用后处理消息(容器调用commitIfNecessary )。

直接使用此消费者可能会产生其他意外的副作用。

我强烈建议使用侦听器容器来使用消息。

如果您只想按需接收消息,请改用RabbitTemplate receive()receiveAndConvert()方法。


BlockingQueueConsumer is not designed to be used directly; it is a component of the SimpleMessageListenerContainer, which will take care of acking the message after it has been consumed by a listener (the container calls commitIfNecessary).

There may be other unexpected side effects of using this consumer directly.

I strongly advise using the listener container to consume messages.

If you just want to receive messages on demand, use a RabbitTemplate receive() or receiveAndConvert() method instead.

相关问答

更多
  • 那么,让我们仔细看看你上面描述的场景。 我认为在问题片段之前立即粘贴文档以提供上下文很重要: AMQP 0-9-1核心规范的第4.7节解释了保证排序的条件:在一个频道中发布的消息,通过一个交换机,一个队列和一个输出频道将按照它们发送的相同顺序接收。 自2.7.0版本以来,RabbitMQ提供了更强大的保证。 使用AMQP方法可以将消息返回到队列,这些方法具有一个requeue参数(basic.recover,basic.reject和basic.nack),或者由于在保存未确认消息时通道关闭。 任何这些情况 ...
  • 好的,我得到了答案错误就在这一行 channel.queueBind(QUEUE_NAME, "offerExchange", "credit"); 我宣布了队列credit1并且绑定了信用。 愚蠢的错误。 Okay i got the answer error was in this line channel.queueBind(QUEUE_NAME, "offerExchange", "credit"); i declared queue credit1 and was binding to cre ...
  • 我在同事的帮助下解决了这个问题。 这真是一个愚蠢的错误。 在属性文件中的值之后选项卡字符 在mq-Config.properties文件中有一个127.0.0.1后: server.host = 127.0.0.1# tab character在这里 因为它无法连接。 我想rabbitMQ并没有从属性文件中修剪东西。 所以即使你的价值后有空间,它也会出乎意料地表现出来。 我删除了制表符。 server.host = 127.0.0.1 之后,它的工作。 I solved it with the help o ...
  • 如果要支持ACK功能,则必须将接收器队列声明为AutoDelete = false 。 这是C#中的一个示例(可能与Java有很小的差异) private bool PushDataToQueue(byte[] data, string queueName, ref string error) { try { if (_connection == null || !_connection.IsOpen) _connection = _factory.C ...
  • 所以,首先,在你谈论的背景下,一条“信息”是为了完成一些工作。 问题的第一部分,通过引用“标记消息”将消息视为有状态对象。 这是不正确的。 一旦生成消息,它就是不可变的,这意味着不允许对其进行更改。 如果你违反了这个原则,或者试图违反这个原则,你已经超越了声音设计的范围。 所以,我们重构。 在一个合适的面向消息的系统中,消息可以表示命令 (“做某事”)或事件 (“发生的事情”)。 请注意,有时我们可以调用回复消息(响应命令发送的内容)第三个类别,但它确实是事件的子类别。 因此,我们有可能(a)一个消息进入一 ...
  • BlockingQueueConsumer不能直接使用; 它是SimpleMessageListenerContainer一个组件,它将在消息被侦听器使用后处理消息(容器调用commitIfNecessary )。 直接使用此消费者可能会产生其他意外的副作用。 我强烈建议使用侦听器容器来使用消息。 如果您只想按需接收消息,请改用RabbitTemplate receive()或receiveAndConvert()方法。 BlockingQueueConsumer is not designed to be ...
  • 好像你有内存泄漏。 使用分析器。 Thanks for the input guys. I resolved the issue. I was creating connection in every worker thread. Now I create the connection on the main thread and pass that down to worker threads who create their channels from that connection. this see ...
  • SignalR提供的SignalR客户端库可能具有一旦失去连接就重新连接的默认行为(JS肯定会这样做)。 因此,拥有池回收只会让您的客户端重新连接到您的服务器,在中断之前再次收到消息。 SignalR client libraries provided by the SignalR might have a default behavior of reconnecting once loosing connection (the JS one definitely does). So having an P ...
  • 为什么是这样 如Yazan所述,消息是以循环方式从单个队列中消耗的。 您所看到的行为是按设计进行的,因此可以轻松扩展给定队列的使用者数量。 如何更改将每条消息发送给每个消费者的行为? 要让每个使用者收到相同的消息,您需要为每个使用者创建一个队列,并将相同的消息传递给每个队列。 最简单的方法是使用fanout交换。 这会将每条消息发送到绑定到交换机的每个队列,完全忽略路由密钥。 如果需要更多控制路由,可以使用topic或direct交换并管理路由密钥。 但是,无论您选择何种类型的交换,您都需要为每个使用者设置 ...
  • api在幕后处理这个问题,所以不用担心。 关于哪个消息到达哪里,RMQ将通过使用循环来传递,即如果你有队列: 1 2 3 4 5 6和consumer1和consumer2 。 consumer1 will have 1 3 5 consumer2 will have 2 4 6 如果连接死于您的任何消费者,预取的消息将使用相同的传递方法重新传递给活跃的消费者。 这应该是有趣的阅读和一个很好的起点,以更准确地说明发生了什么: 我确定你读过的第2号教程 可靠性 The api handles this be ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)