'In-Memory' 是 Mule 中 objectstore 模块的默认配置吗?

Is 'In-Memory' the default configuration of the objectstore module in Mule?

我认为 Mule 中 objectstore 模块的默认配置是 In-Memory (http://mulesoft.github.io/mule-module-objectstore/mule/objectstore-config.html#config)

我在我的应用程序中配置了一个对象库:

<objectstore:config name="sourceConfigStore" entryTtl="60000" ></objectstore:config>

我从 java 组件引用商店,如下所示:

    ObjectStoreModule objectStore = (ObjectStoreModule) eventContext.getMuleContext().getRegistry().lookupObject("sourceConfigStore");

    objectStore.store((String)sourceConfig.get("url"), sourceConfig, true);

这在大多数情况下都有效,除了我今天发现这是在将文件写入磁盘时出现以下错误:

Message               : Unable to create a canonical file for parent: C:\git-ucd\.mule\.mule\edus-esb-rss-aggregator\objectstore and child: DEFAULT_PARTITION\news.ucdavis.edu/xml/getnews.php?type=category&categories=General+Interest&format=rss.obj (org.mule.api.MuleRuntimeException)
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Invalid argument (java.io.IOException)
  java.io.WinNTFileSystem:-2 (null)
2. Unable to create a canonical file for parent: C:\git-ucd\.mule\.mule\edus-esb-rss-aggregator\objectstore and child: DEFAULT_PARTITION\news.ucdavis.edu/xml/getnews.php?type=category&categories=General+Interest&format=rss.obj (org.mule.api.MuleRuntimeException)
  org.mule.util.FileUtils:402 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MuleRuntimeException.html)
3. Unable to create a canonical file for parent: C:\git-ucd\.mule\.mule\edus-esb-rss-aggregator\objectstore and child: DEFAULT_PARTITION\news.ucdavis.edu/xml/getnews.php?type=category&categories=General+Interest&format=rss.obj (org.mule.api.MuleRuntimeException) (org.mule.api.store.ObjectStoreException)
  org.mule.util.store.PartitionedPersistentObjectStore:278 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/store/ObjectStoreException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.IOException: Invalid argument
    at java.io.WinNTFileSystem.canonicalize0(Native Method)
    at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:414)
    at java.io.File.getCanonicalPath(File.java:618)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

所以,我的问题是 objectstore 模块的默认行为是否实际上是使用内存存储。如果是这样的话,我想我的下一个问题是 'how did I override that default behavior with my above config and code'?

默认实现在内存中。 然后,如果您 运行 从 Mule studio 中安装您的应用程序,情况并非如此,因为在 MuleStudio 中,默认情况下它会将内容保存到一个文件中。这就是为什么在常规选项卡的 运行 配置中,您可以选择在每个 运行.

中删除这些文件

在任何情况下,强制进入内存的最简单方法如下:

<objectstore:all-keys config-ref="_defaultInMemoryObjectStore"/>