gpt4 book ai didi

wso2-data-services-server - 使用 ESB 部署时数据服务失败

转载 作者:行者123 更新时间:2023-12-01 22:25:27 24 4
gpt4 key购买 nike

我有一个数据服务,部署在仅 DSS 环境中时可以完美运行。当部署在同时具有 dss 和 esb 的环境中时,确切的数据服务将使具有简单输入参数的操作失败。

任何有关失败原因的指示将不胜感激。

数据服务有两个操作;

  1. 无需输入参数即可简单获取信息,GetLastRequest
  2. 更复杂的获取操作,其中传入单个日期时间参数,GetNewRequests

当部署在仅 DSS 的环境中时,这两个操作都可以使用 TryIT 按预期工作

当部署在 DSS/ESB 环境中时,第一个操作将按预期工作。使用TryIt时第二次操作失败

操作2:获取NewRequests

DSS配置

<data name="ServiceMagnetRequestMonitor" transports="http">
<config id="ServiceMagnetStaging">
<property name="driverClassName">com.mysql.jdbc.Driver</property>
<property name="url">jdbc:mysql://localhost:3307/servicem_staging_engine</property>
<property name="username">root</property>
<property name="password">password</property>
</config>
<config id="ServiceMagnetRulesConfig">
<property name="driverClassName">com.mysql.jdbc.Driver</property>
<property name="url">jdbc:mysql://localhost:3307/servicemagnetrulesconfig</property>
<property name="username">root</property>
<property name="password">password</property>
</config>
<query id="GetLastRequest_SQL" useConfig="ServiceMagnetRulesConfig">
<sql>SELECT datevalue, NOW() as currenttime FROM dateconfigurations WHERE (configname = 'LastInspectionRequest')</sql>
<result element="Configurations" rowName="Configuration">
<element column="datevalue" name="datevalue" xsdType="dateTime"/>
<element column="currenttime" name="currenttime" xsdType="dateTime"/>
</result>
</query>
<query id="GetNewRequests_SQL" useConfig="ServiceMagnetStaging">
<sql>SELECT requests.id, requests.name, requests.telephone, requests.email, languages.name AS preflanguage, locations.name AS location, regions.name AS region, provinces.name AS province, requests.timeframe_date, requests.timeframe, requests.created_at&#13;FROM provinces, regions, locations, requests, languages&#13;WHERE provinces.id = regions.province_id AND regions.id = locations.region_id AND locations.id = requests.location_id AND requests.language_id = languages.id AND (requests.created_at &gt; :LastRequest_IN)</sql>
<result element="Requests" rowName="Request">
<element column="id" name="id" xsdType="string"/>
<element column="name" name="name" xsdType="string"/>
<element column="telephone" name="telephone" xsdType="string"/>
<element column="email" name="email" xsdType="string"/>
<element column="preflanguage" name="preflanguage" xsdType="string"/>
<element column="location" name="location" xsdType="string"/>
<element column="region" name="region" xsdType="string"/>
<element column="province" name="province" xsdType="string"/>
<element column="timeframe_date" name="timeframe_date" xsdType="date"/>
<element column="timeframe" name="timeframe" xsdType="string"/>
<element column="created_at" name="created_at" xsdType="dateTime"/>
</result>
<param name="LastRequest_IN" sqlType="TIMESTAMP"/>
</query>
<operation name="GetLastRequest">
<call-query href="GetLastRequest_SQL"/>
</operation>
<operation name="GetNewRequests">
<call-query href="GetNewRequests_SQL">
<with-param name="LastRequest_IN" query-param="LastRequest_IN"/>
</call-query>
</operation>
</data>

使用 TryIT 返回错误

<soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:axis2ns5336="http://ws.wso2.org/dataservice">
<soapenv:Code>
<soapenv:Value>axis2ns5336:INCOMPATIBLE_PARAMETERS_ERROR</soapenv:Value>
</soapenv:Code>
<soapenv:Reason>
<soapenv:Text xml:lang="en-US">DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:LastRequest_IN
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: ServiceMagnetRequestMonitor
Location: \ServiceMagnetRequestMonitor.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: GetNewRequests
Current Params: {}
</soapenv:Text>
</soapenv:Reason>
<soapenv:Detail>
<axis2ns5335:DataServiceFault xmlns:axis2ns5335="http://ws.wso2.org/dataservice">DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:LastRequest_IN
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: ServiceMagnetRequestMonitor
Location: \ServiceMagnetRequestMonitor.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: GetNewRequests
Current Params: {}
</axis2ns5335:DataServiceFault>
</soapenv:Detail>
</soapenv:Fault>

最佳答案

以下内容实际上解决了上述问题,但真正的解决方案看起来需要 WSO2 的修复。我将为其记录一个 JIRA。

请注意,以下说明不会导致您的安装或进一步升级出现任何问题。这些更改是纯配置并完全受支持。

问题如报告所述。在同一实例中运行 DSS 和 ESB 会导致某些带有输入参数的 DSS 失败。

解决方案 --> 解决方法简而言之,在缺陷得到解决之前,您无法在同一个 Carbon 实例中运行 DSS 和 ESB。但是,您可以在两台计算机上运行 DSS 和 ESB,或者如下所述,在同一台计算机上运行两个实例。

呃,哎呀,罗布,如果解决方案只是为了进行 DSS 操作,为什么要经历所有这些努力呢?为什么不只设置 dss 而忘记 esb 呢?答案是因为想要在一台机器上同时使用 dss 和 esb 的功能。如果您需要的只是基本的 dss 功能,那么您可以停止阅读。但如果您需要同一台计算机上的这两个功能,请继续。

在一台机器上运行 ESB 和 DSS

  1. 独立安装 DSS 和 ESB。
  2. 确保两者都没有运行
  3. ESB 必须以端口偏移量 1 启动。端口偏移量可以在/repository/conf/carbon.xml 文件中设置,其中是 ESB 二进制分发文件夹。设置偏移值为1
  4. 启动两个实例
  5. ESB 现在需要一个代理来连接我们遇到问题的 DSS 服务。使用以下指令在 esb 到 dss 中创建直通代理 https://docs.wso2.com/display/ESB470/Pass+Through+Proxy+Template
  6. 现在使用 esb 中的 TRYIT。成功了!

希望您觉得这有帮助。

关于wso2-data-services-server - 使用 ESB 部署时数据服务失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30279286/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com