使用Mule 4插入/更新对Heroku Postgresql无效
我尝试了不同的驱动程序版本、mule版本、不同的表,但无法将mule插入/更新到Heroku Postgresql 我尝试使用Java代码在Heroku postgresql上插入,以检查任何写访问问题,但效果很好 我在本地postgreql上试过的同一个应用程序在本地postgreql上一切正常,但在heroku postgreql上却不行 注意:如果我没有设置输入参数和硬编码值,那么它也可以工作 带有输入参数值的Mule和Heroku postgresql有什么问题? 我没有收到任何错误,也没有例外,因此,[在此处输入图像描述][1]无法理解问题 请帮帮我,我卡住了 输入我试图设置为的参数值:使用Mule 4插入/更新对Heroku Postgresql无效,mule,Mule,我尝试了不同的驱动程序版本、mule版本、不同的表,但无法将mule插入/更新到Heroku Postgresql 我尝试使用Java代码在Heroku postgresql上插入,以检查任何写访问问题,但效果很好 我在本地postgreql上试过的同一个应用程序在本地postgreql上一切正常,但在heroku postgreql上却不行 注意:如果我没有设置输入参数和硬编码值,那么它也可以工作 带有输入参数值的Mule和Heroku postgresql有什么问题? 我没有收到任何错误,也
{
"Id":payload.Id,
"AccountId": payload.AccountId,
"OwnerId": payload.OwnerId,
"ContractId": payload.ContractId,
"Pricebook2Id": payload.Pricebook2Id,
"OrderNumber": payload.OrderNumber,
"IsReductionOrder": payload.IsReductionOrder as Boolean,
"Status": payload.Status,
"Name": payload.Name,
"TotalAmount": payload.TotalAmount,
"EffectiveDate":payload.EffectiveDate as Date
}
Mule配置:
<db:config name="Database_Config" doc:name="Database Config" doc:id="db823135-d287-439f-ad77-76652012b66f" >
<db:generic-connection url="xxx" driverClassName="org.postgresql.Driver" user="xxx" password="xxx" />
</db:config>
<flow name="testherokuFlow" doc:id="5ac6fe61-525a-4ede-8163-43ad4d402f76" >
<scheduler doc:name="Scheduler" doc:id="27b640f6-f8b2-4e06-9c44-ddf5941b99c7" >
<scheduling-strategy >
<fixed-frequency frequency="15" timeUnit="SECONDS"/>
</scheduling-strategy>
</scheduler>
<set-payload value='#[{
"Id": "8012w000000De1qAAC",
"AccountId": "0012w00000KY8kFAAT",
"OwnerId": "0052w000006WxYiAAK",
"ContractId": "8002w000000YBG6AAO",
"Pricebook2Id": "01s2w00000C4oj9AAB",
"OrderNumber": "00000101",
"IsReductionOrder": "false",
"TotalAmount": "110000.0",
"EffectiveDate": "2020-09-24",
"Status": "Draft",
"Name": null,
"BillingCity": null,
"ActivatedDate": null,
"ShipToContactId": null,
"CompanyAuthorizedById": null,
"CustomerAuthorizedDate": null,
"BillingPostalCode": null,
"ShippingStreet": null,
"CustomerAuthorizedById": null,
"ShippingPostalCode": null,
"ShippingState": null,
"BillingState": null,
"BillingAddress": null,
"ShippingCountry": null,
"ShippingCity": null,
"OrderReferenceNumber": null,
"OriginalOrderId": null,
"CompanyAuthorizedDate": null,
"BillToContactId": null,
"EndDate": null,
"BillingCountry": null,
"BillingStreet": null,
"ShippingAddress": null
}]' doc:name="Set Payload" doc:id="94fc6b1f-eb99-427e-afad-79cca35ec130" />
<logger level="INFO" doc:name="Logger" doc:id="f14f263b-baad-4ad3-94dc-c65546f3dfb2" message="Insert in progress"/>
<db:insert doc:name="Insert" doc:id="7d1f1a43-b257-4a6d-83c0-dc48d652e44a" config-ref="Database_Config">
<db:sql ><![CDATA[insert into sf_order (id, account_id, owner_id,contract_id,pricebook2_id,order_number,is_reduction_order,status, name, total_amount, effective_date)
VALUES (:Id, :AccountId, :OwnerId,:ContractId,:Pricebook2Id,:OrderNumber,:IsReductionOrder,:Status, :Name, :TotalAmount,:EffectiveDate) ]]></db:sql>
<db:input-parameters ><![CDATA[#[{
"Id":payload.Id,
"AccountId":payload.AccountId,
"OwnerId":payload.OwnerId,
"ContractId":payload.ContractId,
"Pricebook2Id":payload.Pricebook2Id,
"OrderNumber":payload.OrderNumber,
"IsReductionOrder":if(payload.IsReductionOrder==null or payload.IsReductionOrder=="null") ("false" as Boolean) else (payload.IsReductionOrder) as Boolean,
"Status":payload.Status,
"Name":payload.Name,
"TotalAmount":payload.TotalAmount,
"EffectiveDate":payload.EffectiveDate as Date
}]]]></db:input-parameters>
</db:insert>
<logger level="INFO" doc:name="Logger" doc:id="f6cc1c2e-f99d-425e-9b8b-b6bfa756caeb" message="Insert done"/>
</flow>
设置的参数ID与插入中使用的ID的大小写不匹配。尽量使两种情况都匹配 例如
“Id”:payload.Id
设置Id
,但查询使用(Id,
(小写“i”)
将它们都设置为“Id”或“Id”。您好,请以XML格式共享流程(请不要截图),包括配置,不包括主机名和凭据等机密数据。这里是:我的意思是编辑问题;-)我面临的问题是,当我使用单引号设置值时,这些值是硬括的值('value1','value2')然后将value1和value2插入各自的列中。但是,当我将其作为值(:value1,:value2)进行动态时,这里value1和value2是占位符,而实际内容在输入参数中设置为:#[{“value1”:“aa”,“value2”:“bb”}]然后它对我有效。它甚至没有给出任何错误,数据也没有插入。最后,经过长时间和奇怪的惊喜,我理解了什么不起作用。1.正如我所说,没有错误/异常,也没有发生插入。这一次,我在到达插入连接器后保持应用程序运行。2分钟后,我发现插入已完成。现在的问题是为什么2分钟?然而,我相信这与mule无关。