Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在mule中的流之间读取mule中的数据库_Mule_Mule Studio - Fatal编程技术网

在mule中的流之间读取mule中的数据库

在mule中的流之间读取mule中的数据库,mule,mule-studio,Mule,Mule Studio,我正和骡子一起进行第二周的探险。 我的要求是根据http端点的输入读取数据库或文件。 我试图在流程中使用一个选项,确定输入的性质,然后从不同的方向流出。 但我的问题是,我不确定如何使用查询值或文件值设置消息 有人能帮我做一些输入吗?请查看此模块 它可以在流中的任意点请求资源。它用于最初仅由消息源请求的资源 用例包括: 加载一个文件在流的中间 从流中间的队列中消耗消息(一,n,all)。< /LI> 按需从邮件服务器中提取邮件,例如在enricher中使用邮件服务器的数据 它是一个围绕典型的

我正和骡子一起进行第二周的探险。 我的要求是根据http端点的输入读取数据库或文件。 我试图在流程中使用一个选项,确定输入的性质,然后从不同的方向流出。 但我的问题是,我不确定如何使用查询值或文件值设置消息


有人能帮我做一些输入吗?

请查看此模块

它可以在流中的任意点请求资源。它用于最初仅由消息源请求的资源

用例包括:

    加载一个文件在流的中间 从流中间的队列中消耗消息(一,n,all)。< /LI>
  • 按需从邮件服务器中提取邮件,例如在enricher中使用邮件服务器的数据
它是一个围绕典型的muleContext.getClient()调用的简单devkit包装器

public Object request(String resource, @Optional @Default("1000") long timeout, @Optional String returnClass, @Optional Boolean throwExceptionOnTimeout) throws MuleException {
        MuleMessage message = muleContext.getClient().request(resource, timeout);
        Object result = null;
        if (message != null)
        {
            result = message.getPayload();
            if (returnClass != null)
            {
                try {
                    Transformer transformer = muleContext.getRegistry().lookupTransformer(DataTypeFactory.create(result.getClass()), DataTypeFactory.create(Class.forName(returnClass)));
                    result = transformer.transform(result);
                } catch (ClassNotFoundException e) {
                    throw new DefaultMuleException(e);
                }
            }
        } else if (Boolean.TRUE.equals(throwExceptionOnTimeout))
        {
            throw new DefaultMuleException("No message received in the configured timeout - " + timeout);
        }
        return result;
    }