简体   繁体   English

收到此错误 org.mule.runtime.api.store.ObjectAlreadyExistsException: Object 已存在密钥

[英]Getting this error org.mule.runtime.api.store.ObjectAlreadyExistsException: Object already exists for the key

I am getting this error on cloudhub "org.mule.runtime.api.store.ObjectAlreadyExistsException: Object already exists for the key".我在 cloudhub 上收到此错误“org.mule.runtime.api.store.ObjectAlreadyExistsException: Object 已存在密钥”。

I am using object store in my application.我在我的应用程序中使用 object 存储。 Where I am checking if the value is available in object store and then store it only if it is not available.我在哪里检查该值是否在 object 存储中可用,然后仅在它不可用时存储它。 I have set the option to "Fail if present" as false, still seeing this error.我已将“如果存在则失败”选项设置为 false,仍然看到此错误。

How to resolve this?如何解决这个问题?

I observed that this issue is coming only when I am using two workers in cloudhub.我观察到只有当我在 cloudhub 中使用两个工作人员时才会出现这个问题。

Thanks in advance.提前致谢。

Edited: Using Object Store connector and mule 4.3.编辑:使用 Object Store 连接器和 mule 4.3。 I am checking in object store using Contains if value exists.如果值存在,我正在使用包含检查 object 存储。 If it does then Retrieving the value else Storing it to OS.如果确实如此,则检索该值,否则将其存储到操作系统。

Error错误在此处输入图像描述

Edit2: ObjectStore in Cloudhub: Edit2:Cloudhub 中的 ObjectStore: 在此处输入图像描述

The error message indicates that the application is using the default persistent object store.错误消息表明应用程序正在使用默认的持久 object 存储。 For sharing to multiple workers you should instead use the _defaultUserObjectStore which is in memory.要与多个工作人员共享,您应该改用 memory 中的_defaultUserObjectStore Details are in: https://docs.mulesoft.com/object-store/osv2-faq#how-are-object-store-entries-divided-among-workers详细信息在: https://docs.mulesoft.com/object-store/osv2-faq#how-are-object-store-entries-divided-among-workers

You can try this approach!你可以试试这个方法!

Use a retrieve connector and wrap it in Try block.使用检索连接器并将其包装在 Try 块中。 And define it own error handling strategy, in which use store connector in On Error Continue block.并定义它自己的错误处理策略,在 On Error Continue 块中使用 store 连接器。 What it will do is, first it will try to retrieve the values stored in Object Store.它将首先尝试检索存储在 Object 存储中的值。 If the keys will be present, respective values will be fetched.如果存在键,则将获取相应的值。 If the key is not present, an error will occur which will be handled by the error handler and will store the key to object store.如果密钥不存在,则会发生错误,该错误将由错误处理程序处理并将密钥存储到 object 存储区。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mule 4:map 值,如果密钥存在 - Mule 4: map value if key exists 将密钥/对转换为 Object - Mule 4 - Transform key/pair into in an Object - Mule 4 Object Store 不共享 b/w mule 运行时 - Object Store Not getting shared b/w the mule runtimes 与 API Manager 交谈时出错:{"name":"UniqueConstraintError","message":"API 的部署已经存在"} - Error talking to API Manager: {"name":"UniqueConstraintError","message":"Deployment already exists for the API"} 无法安装 MULE EE 服务 指定的服务已存在 (0x411) - Unable to Install MULE EE Service The Specified Service already exists (0x411) 在 mule4 中调用 API 时出现一般 SSL 引擎问题 - Getting general SSL Engine problem while calling API in mule4 清除 Mule 4 中的缓存范围和私有对象存储 - Clear the Cache Scope and Private object store in Mule 4 如何在 mule 4 中在运行时创建流 - How to create a flow in runtime in mule 4 在我的本地 anypoint 工作室或您可以说本地机器上重新部署 Mule Api 时出现错误 - I am getting an error when redeploying the Mule Api on my local anypoint studio or you can say local machine 在没有 Mule 运行时环境的情况下,卡在运行 Mule Jar 文件 - Stuck on running Mule Jar file without Mule Runtime environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM