Skip to main content

#Message0 人正在讨论

Here is my flow

 

I tried to acknowledged but having "The Consumer is closed " error

 Flow :

 <?xml version="1.0" encoding="UTF-8"?>

 <mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:http="http://www.mulesoft.org/schema/mule/http"

 

xmlns="http://www.mulesoft.org/schema/mule/core"

 

xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd

 

http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd

 

http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">

 

<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="89e0f34b-6b83-4776-99d1-080637d3150b" >

 

<http:listener-connection host="0.0.0.0" port="8081" />

 

</http:listener-config>

 

<jms:config name="JMS_Config" doc:name="JMS Config" doc:id="e8e28a6d-297f-43ae-8f73-699b80d70980" >

 

<jms:active-mq-connection username="admin" password="******" >

 

<jms:caching-strategy >

 

<jms:no-caching />

 

</jms:caching-strategy>

 

<jms:factory-configuration brokerUrl="tcp://localhost:61616" />

 

</jms:active-mq-connection>

 

<expiration-policy maxIdleTime="1000000" timeUnit="MILLISECONDS" />

 

<jms:producer-config timeToLive="100000" />

 

</jms:config>

 

<flow name="consumemessageactivemqFlow" doc:id="d4448da9-afad-46c4-b328-7cf25fcb70e5" >

 

<http:listener doc:name="Listener" doc:id="7af095a3-903b-4cef-bcea-c04744cd8ce9" config-ref="HTTP_Listener_config" path="/consume"/>

 

<jms:consume doc:name="Consume" doc:id="0ed7c1f3-56e8-4a93-9ab6-e0e3c852eb03" config-ref="JMS_Config" destination="test1" ackMode="MANUAL" maximumWait="100000" transactionalAction="NOT_SUPPORTED" target="test" targetValue="#message">

 

<reconnect-forever />

 

<jms:consumer-type >

 

<jms:queue-consumer />

 

</jms:consumer-type>

 

</jms:consume>

 

<logger level="INFO" doc:name="Logger" doc:id="4b81f117-0b1e-490a-a681-dc07b78b7bea" message="#payload"/>

 

<jms:ack doc:name="Ack" doc:id="f1f780d8-67ac-4859-963c-8c9c9edbfc90" ackId="#vars.test.attributes.ackId" />

 

</flow>

 

</mule>

 

 Exception:

 

INFO 2021-04-10 09:39:37,390 [[MuleRuntime].uber.03: [consumemessageactivemq].consumemessageactivemqFlow.CPU_LITE @10875769] [processor: consumemessageactivemqFlow/processors/1; event: 907642f0-99b2-11eb-b7f5-7c76357e16b6] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: 

 

ERROR 2021-04-10 09:39:37,496 [[MuleRuntime].uber.03: [consumemessageactivemq].consumemessageactivemqFlow.CPU_LITE @10875769] [processor: consumemessageactivemqFlow/processors/2; event: 907642f0-99b2-11eb-b7f5-7c76357e16b6] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: 

 

********************************************************************************

 

Message    : The Consumer is closed

 

Element    : consumemessageactivemqFlow/processors/2 @ consumemessageactivemq:consumemessageactivemq.xml:30 (Ack)

 

Element DSL   : <jms:ack doc:name="Ack" doc:id="f1f780d8-67ac-4859-963c-8c9c9edbfc90" ackId="#vars.test.attributes.ackId"></jms:ack>

 

Error type   : MULE:UNKNOWN

 

FlowStack    : at consumemessageactivemqFlow(consumemessageactivemqFlow/processors/2 @ consumemessageactivemq:consumemessageactivemq.xml:30 (Ack)

22 个回答
  1. 2021年4月17日 08:07

    Ok you mean empty

    because it has only 2 options immediate and manual

    but why for manual type ack activity giving such erro

0/9000

Hi guys,

 

I want to generate PDF of dashboard and want to sent it through email to related users on scheduled basis.

how to perform it ? PDF should be based on mapping means if an user belong to North region the report should

contain data of north region only.

 

Regards

Inder

3 个回答
  1. 2019年1月7日 15:05

    I found it easier to use PowerShell. Try the following

    https://interworks.com/blog/tladd/2013/08/22/automated-pdf-email-distribution-tableau-views-using-powershell-and-tabcmd/

     

    You will need the url where, the Dashboard is located and login details to access the view. Make sure you write the powershell script on the drive where tbcmd is located. I used Outlook as my mail program. The following example might get you started;

     

    $ErrorActionPreference = "Stop"

    #$csvfile = import-csv -path "C:\AutoTemp\users.csv" You can use this line to get a list of email addresses

    $csvfile = import-csv -path "C:\AutoTemp\Tests\pwd.txt"

     

    tabcmd login -s http://address:8000 -u partaddress.local\loginUserName -p password

     

    ⌗Creates the pdf

    tabcmd get "/views/DashboardAddress" -f "C:\AutoTemp\Tests\pass1.pdf"

     

    $smtp = new-object Net.Mail.SmtpClient("10.100.0.30")

    $smtp.Credentials = New-Object System.Net.NetworkCredential;

    $smtp.Timeout = 1000000

    $msg = new-object Net.Mail.MailMessage

     

    $attach = new-object Net.Mail.Attachment("C:\AutoTemp\Tests\pass1.pdf")

        

    #Message from

    $msg.From = "a.ab@hotmail.co.uk"

     

    # Message to

    $msg.To.Add("n.g@outlook.com")

         

    $msg.Attachments.add($attach)

     

    $msg.subject = "Get your pdf"

    $msg.body = "This is your start"

                       

    $smtp.Send($msg)

    $msg.Dispose()

0/9000
4 个回答
0/9000
6 个回答
  1. 2020年12月1日 22:17

    Hi,

     

    Please use below code.

     

    %dw 2.0

    output application/json

    var inputDate ='11-30-2020 00_00_00'

    ---

    {

    inputDateFormatted: (inputDate as LocalDateTime {format:"MM-dd-yyyy HH_mm_ss"}) as String {format:"yyyy-MM-dd'T'HH:mm:ss"}

    }

    Output

     

    {

    "inputDateFormatted": "2020-11-30T00:00:00"

    }

    Regards,

    Jitendra

0/9000
2 个回答
0/9000

I am trying to develop a custom policy for my client. Everything works fine, but when I try to capture headers list from the response message, it always comes as empty - Headers:[]. The logger statement below prints the complete "message" structure, but headers always empty.

 

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"

xmlns:ee="http://www.mulesoft.org/schema/mule/ee/core"

xmlns:http="http://www.mulesoft.org/schema/mule/http"

xmlns="http://www.mulesoft.org/schema/mule/core"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:http-policy="http://www.mulesoft.org/schema/mule/http-policy"

xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd

http://www.mulesoft.org/schema/mule/http-policy http://www.mulesoft.org/schema/mule/http-policy/current/mule-http-policy.xsd

http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd"> 

<http-policy:proxy name="{{{policyId}}}-custom-policy">

<http-policy:source>

<http-policy:execute-next/>

<logger level="INFO" message="#message" />

</http-policy:source>

</http-policy:proxy></mule>

 

The output in logs:

{ payload=org.mule.runtime.core.internal.streaming.bytes.ManagedCursorStreamProvider@4180b81f

mediaType=application/json; charset=UTF-8

attributes=org.mule.extension.http.api.HttpResponseAttributes

{

Status Code=200

Reason Phrase=null

Headers=[]

}

attributesMediaType=*/*

}

The API does return Headers as expected, when debugged in Anypoint Studio.

 

Any idea?

 

Thanks!

4 个回答
0/9000

Here is my flow

 

I tried to acknowledged but having "The Consumer is closed " error

 Flow :

 <?xml version="1.0" encoding="UTF-8"?>

 <mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:http="http://www.mulesoft.org/schema/mule/http"

 

xmlns="http://www.mulesoft.org/schema/mule/core"

 

xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd

 

http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd

 

http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">

 

<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" doc:id="89e0f34b-6b83-4776-99d1-080637d3150b" >

 

<http:listener-connection host="0.0.0.0" port="8081" />

 

</http:listener-config>

 

<jms:config name="JMS_Config" doc:name="JMS Config" doc:id="e8e28a6d-297f-43ae-8f73-699b80d70980" >

 

<jms:active-mq-connection username="admin" password="******" >

 

<jms:caching-strategy >

 

<jms:no-caching />

 

</jms:caching-strategy>

 

<jms:factory-configuration brokerUrl="tcp://localhost:61616" />

 

</jms:active-mq-connection>

 

<expiration-policy maxIdleTime="1000000" timeUnit="MILLISECONDS" />

 

<jms:producer-config timeToLive="100000" />

 

</jms:config>

 

<flow name="consumemessageactivemqFlow" doc:id="d4448da9-afad-46c4-b328-7cf25fcb70e5" >

 

<http:listener doc:name="Listener" doc:id="7af095a3-903b-4cef-bcea-c04744cd8ce9" config-ref="HTTP_Listener_config" path="/consume"/>

 

<jms:consume doc:name="Consume" doc:id="0ed7c1f3-56e8-4a93-9ab6-e0e3c852eb03" config-ref="JMS_Config" destination="test1" ackMode="MANUAL" maximumWait="100000" transactionalAction="NOT_SUPPORTED" target="test" targetValue="#message">

 

<reconnect-forever />

 

<jms:consumer-type >

 

<jms:queue-consumer />

 

</jms:consumer-type>

 

</jms:consume>

 

<logger level="INFO" doc:name="Logger" doc:id="4b81f117-0b1e-490a-a681-dc07b78b7bea" message="#payload"/>

 

<jms:ack doc:name="Ack" doc:id="f1f780d8-67ac-4859-963c-8c9c9edbfc90" ackId="#vars.test.attributes.ackId" />

 

</flow>

 

</mule>

 

 Exception:

 

INFO 2021-04-10 09:39:37,390 [[MuleRuntime].uber.03: [consumemessageactivemq].consumemessageactivemqFlow.CPU_LITE @10875769] [processor: consumemessageactivemqFlow/processors/1; event: 907642f0-99b2-11eb-b7f5-7c76357e16b6] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: 

 

ERROR 2021-04-10 09:39:37,496 [[MuleRuntime].uber.03: [consumemessageactivemq].consumemessageactivemqFlow.CPU_LITE @10875769] [processor: consumemessageactivemqFlow/processors/2; event: 907642f0-99b2-11eb-b7f5-7c76357e16b6] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler: 

 

********************************************************************************

 

Message    : The Consumer is closed

 

Element    : consumemessageactivemqFlow/processors/2 @ consumemessageactivemq:consumemessageactivemq.xml:30 (Ack)

 

Element DSL   : <jms:ack doc:name="Ack" doc:id="f1f780d8-67ac-4859-963c-8c9c9edbfc90" ackId="#vars.test.attributes.ackId"></jms:ack>

 

Error type   : MULE:UNKNOWN

 

FlowStack    : at consumemessageactivemqFlow(consumemessageactivemqFlow/processors/2 @ consumemessageactivemq:consumemessageactivemq.xml:30 (Ack)

0/9000

We have a requirement to call an oracle stored procedure which has two UDT parameters one IN and one OUT. We are doing this in mule 4. I am able to set the Custom Type and pass the UDT parameters to the stored procedure and get the out parameter. But The output Json only has the values, not the column names mapped to it? How do I get the column names also in the payload?

 

Here is the output I am getting I need the column names also

 

{

    "p_return_message_o": null,

    "p_eem_shipind_docs_o": [

        "DOCTESTTIME",

        "TEST",

        "TESTINV",

        null,

        12345,

        "TEST",

        "TESTIRN",

        "USD",

        [ ],

        [ ],

    "p_return_code_o": "SUCCESS"

}

 

Here is my xml

 

<db:config name="dbConfig" doc:name="Database Config" doc:id="8a74e699-6893-45a8-8ef9-9edb24927cb4" >

<db:oracle-connection host="scan-nprd-2023" port="1541" user="apps" password="P0t3ntial" serviceName="DV1CSF_SRVC_OTH.cisco.com" >

<db:column-types >

<db:column-type id="2002" typeName="XXCTS_EEM_OUTBOUND_EVENT_OBJ" />

<db:column-type id="2002" typeName="XXCTS_EEM_SHIPPIND_DOC_OBJ" />

<db:column-type id="2003" typeName="XXCTS_EEM_SHIPIND_DOC_LINE_TAB" />

<db:column-type id="2003" typeName="XXCTS_EEM_SHIPINDOC_ADDR_TAB" />

</db:column-types>

</db:oracle-connection>

</db:config>

<flow name="SharedDBFlow" doc:id="61315463-e2d4-45af-a15b-d3c873885ddb" >

<ee:transform doc:name="Transform Message" doc:id="274ce134-2c91-4321-8bd4-0f321dbe2c47" >

<ee:message >

<ee:set-payload ><![CDATA[%dw 2.0

output application/java

---

[

 payload.Transaction.auditReferenceId,payload.Transaction.locationCode,payload.Transaction.transactionType,

 payload.Transaction.transactionSubType,

 payload.Transaction.conversationId,

 payload.Transaction.canonicalTransactionType,

 payload.Transaction.muleTransactionId,

 payload.Transaction.attribute1,

 payload.Transaction.attribute2,

 payload.Transaction.attribute3,

 payload.Transaction.attribute4,

 payload.Transaction.attribute5,

 payload.Transaction.attribute6,

 payload.Transaction.attribute7,

 payload.Transaction.attribute8,

 payload.Transaction.attribute9,

 payload.Transaction.attribute10,

]

]]></ee:set-payload>

</ee:message>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="92ce9028-798e-41e8-b8cf-085fcb501215" message="#payload"/>

<ee:transform doc:name="Transform Message" doc:id="b9f3ada5-7259-4c9b-94e2-2270c0e13dbf" >

<ee:message >

</ee:message>

<ee:variables >

<ee:set-variable variableName="in_ob_event_obj" ><![CDATA[%dw 2.0

output application/java

---

Db::createStruct("dbConfig","XXCTS_EEM_OUTBOUND_EVENT_OBJ",payload)]]></ee:set-variable>

</ee:variables>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="8a229fd3-f9d8-466d-bf14-74c7b599f135" message="#vars.in_ob_event_obj"/>

<db:stored-procedure doc:name="Stored procedure" doc:id="7fe3f61b-74a6-4503-a59e-cdc643c79229" config-ref="dbConfig">

<db:sql ><![CDATA[{ call xxtest_shipind_docs(:p_outb_event_rec_i,:p_eem_shipind_docs_o,:p_return_code_o,:p_return_message_o) }]]></db:sql>

<db:input-parameters ><![CDATA[#[{ 

p_outb_event_rec_i: vars.in_ob_event_obj

 

}]]]></db:input-parameters>

<db:output-parameters >

<db:output-parameter key="p_return_code_o" type="VARCHAR" />

<db:output-parameter key="p_return_message_o" type="VARCHAR" />

<db:output-parameter key="p_eem_shipind_docs_o" customType="XXCTS_EEM_SHIPPIND_DOC_OBJ" />

</db:output-parameters>

</db:stored-procedure>

<logger level="INFO" doc:name="Logger" doc:id="7d22fdef-1f5f-40f4-9953-b001a1ac40c8" message="#message"/>

<ee:transform doc:name="Transform Message" doc:id="0feed9a7-7e8c-4a4c-ae22-2437d110d0fe" >

<ee:message >

<ee:set-payload ><![CDATA[%dw 2.0

output application/json

---

payload]]></ee:set-payload>

</ee:message>

</ee:transform>

<logger level="INFO" doc:name="Logger" doc:id="a9c7071a-d00c-4c20-ac83-242ec3e20945" message="#payload"/>

</flow>

0/9000

The migration tool generated a set property compatability connector, but is there anything I can use instead of that? Typically in my experience, anything the migration tool automatically generates needs modifications, and I was wondering if that's the case here. I am using this connector to set http status.

5 个回答
0/9000
10 个回答
  1. Shekh Muenuddeen (NTTData) Forum Ambassador
    2020年8月18日 11:33

    Hi,

     

    In both cases you are printing message in the logger, so for both case its printing input request attributes headers information for JSON post and XML post request.

     

    that why you are getting different content length because in message logger it printing input headers for both request.

     

    Output of Dataweave is always having the same content length because we are always converting input payload to XML

     

    Please check below Postmen screen shot as I am showing you response header content length.

     

    And its same for both JSON and XML request.

     

    Hi, In both cases you are printing message in the logger, so for both case its printing input request attributes headers information for JSON post and XML post request.

     

    Regards,

    Shekh

0/9000