I'm pretty New to Java and Mulesoft, I have been working on one POC. It's nothing but capturing the Database Change Notification in Mule, where DB polling cannot be implemented due to performance issues & Datamapper cannot be used. Can anyone suggest me the right approach on this. Below is my sample code on which I have been working.
<db:oracle-config name="Oracle_Configuration" host="localhost" port="1521" instance="xe" user="HR" password="hr" doc:name="Oracle Configuration1"/>
<file:connector name="OutPutFile" autoDelete="false" streaming="true" validateConnections="true" doc:name="File" outputAppend="true" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" dynamicNotification="true" writeToDirectory="C:\Users\IBM_ADMIN\MulesoftExamples"/>
<db:oracle-config name="Oracle_Configuration1" url="jdbc:thin.oracle://localhost:1521/HR" doc:name="Oracle Configuration1" transactionIsolation="READ_COMMITTED"/>
<http:request-config name="HTTP_Request_Configuration" host="localhost" port="1521" basePath="alertcapture" doc:name="HTTP Request Configuration"/>
<file:endpoint path="C:\Users\IBM_ADMIN\MulesoftExamples" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" connector-ref="File" name="File" responseTimeout="10000" encoding="UTF-8" doc:name="File"/>
<flow name="alertcaptureFlow">
<poll doc:name="Poll">
<db:select config-ref="Oracle_Configuration" doc:name="ChangeNotify" target="#[flowVars.selectResult]" >
<db:parameterized-query><![CDATA[SELECT * FROM nfevents;]]></db:parameterized-query>
</db:select>
</poll>
<http:request config-ref="HTTP_Request_Configuration" path="/alertcapture/src/main/app" method="GET" doc:name="FetchData"/>
<file:outbound-endpoint path="/alertcapture/src/main/app" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].txt" connector-ref="OutPutFile" responseTimeout="10000" doc:name="Alertcapture" encoding="UTF-8" mimeType="text/xml" ref="File"/>
</flow>
>
Related
I'm using NLog and I'm getting the following:
[2021-10-06 11:52:51.1554] [INFO] [AccountController] admin Logged in. |user: notauth::
[2021-10-06 11:53:12.4143] [INFO] [UsersController] User info was changed for "Joe" |user: auth:ApplicationCookie:admin
[2021-10-06 11:53:19.8374] [INFO] [AccountController] admin Logged out. |user: auth:ApplicationCookie:admin
There are 2 issues:
Problem1: when I log who logged in, the user name is still not set.
Problem2: the username in the subsequent logs is shown with a prefix "auth:ApplicationCookie". I do not want that.
Here is my NLog.config
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off" internalLogFile="c:\temp\nlog-internal.log">
<targets>
<target name="file" xsi:type="File" archiveFileName="${basedir}/Logs/Archive/nlog-{########}.log"
archiveNumbering = "Date" archiveDateFormat = "yyyyMMdd"
maxArchiveFiles="30" archiveEvery="Day"
fileName="${basedir}/Logs/nlog.log"
layout="[${longdate}] [${uppercase:${level}}] [${logger}] ${message} ${exception:format=tostring}|user: ${identity}"
concurrentWrites="false" keepFileOpen="false"/>
<target name="console" xsi:type="ColoredConsole"
layout="[${longdate}] [${uppercase:${level}}] [${logger:shortName=true}] ${message} ${exception:format=tostring}" />
</targets>
<rules>
<logger name="*" writeTo="console,file" />
</rules>
</nlog>
Any ideas?
I'm trying to get a document from Alfresco 5.2 using CMIS web services binding (http://server:8080/alfresco/cmisws/cmis?wsdl) and get an error.
Using the wireshark I found that the problem is that the alfresco in the response returns cmis:item element. But according to cmis 1.0 protocol it should not be returned. Why is this happening?
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="0">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2017-10-06T15:33:27.634Z</wsu:Created>
</wsu:Timestamp>
<wsse:UsernameToken>
<wsse:Username>admin</wsse:Username>
<wsse:Password wsse:Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">0000</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ns2:getTypeDescendants xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/">
<ns2:repositoryId>53131d3f-d80b-4964-87d9-08b614fe7861</ns2:repositoryId>
<ns2:depth>-1</ns2:depth>
<ns2:includePropertyDefinitions>false</ns2:includePropertyDefinitions>
</ns2:getTypeDescendants>
</soapenv:Body>
</soapenv:Envelope>
Response(part):
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getTypeDescendantsResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/">
<types>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:cmisTypeItemDefinitionType">
<ns2:id>cmis:item</ns2:id>
<ns2:localName>item</ns2:localName><ns2:localNamespace>http://www.alfresco.org/model/cmis/1.0/cs01</ns2:localNamespace>
<ns2:displayName>Item Type</ns2:displayName>
<ns2:queryName>cmis:item</ns2:queryName>
<ns2:description>CMIS Item</ns2:description>
<ns2:baseId>cmis:item</ns2:baseId>
<ns2:creatable>false</ns2:creatable>
<ns2:fileable>false</ns2:fileable>
<ns2:queryable>false</ns2:queryable>
<ns2:fulltextIndexed>true</ns2:fulltextIndexed>
<ns2:includedInSupertypeQuery>true</ns2:includedInSupertypeQuery>
<ns2:controllablePolicy>true</ns2:controllablePolicy>
<ns2:controllableACL>true</ns2:controllableACL>
</type>
Is there a SOAP API alternative for geo-autocomplete that is available in REST API? Is it EncodeDecodeLLSRQ? If so, it is always providing the below response when I try with the below provided request. I get the same response for the example provided in doc too.
<EncodeDecodeRS Version="2.0.0" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01">
<stl:ApplicationResults status="NotProcessed">
<stl:Error type="Application" timeStamp="2016-10-26T03:33:02-05:00">
<stl:SystemSpecificResults>
<stl:Message>Unexpected request processing error</stl:Message>
<stl:ShortText>ERR.SWS.PROVIDER.REQUEST_HANDLER_ERROR</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</EncodeDecodeRS>
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns="http://webservices.sabre.com/sabreXML/2011/10">
<soapenv:Header>
<sec:Security>
<sec:BinarySecurityToken>--Token--</sec:BinarySecurityToken>
</sec:Security>
<mes:MessageHeader>
<mes:From>
<mes:PartyId>from</mes:PartyId>
</mes:From>
<mes:To>
<mes:PartyId>ws</mes:PartyId>
</mes:To>
<mes:CPAId>--CPAId--</mes:CPAId>
<mes:ConversationId>eservices#sabre.com</mes:ConversationId>
<mes:Action>EncodeDecodeLLSRQ</mes:Action>
<mes:MessageData>
<mes:MessageId>00000</mes:MessageId>
<mes:Timestamp>233</mes:Timestamp>
</mes:MessageData>
</mes:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<ns:EncodeDecodeRQ Version="2.0.0">
<ns:Encode>
<ns:Address>
<ns:CityName>Atlanta</ns:CityName>
</ns:Address>
</ns:Encode>
</ns:EncodeDecodeRQ>
</soapenv:Body>
</soapenv:Envelope>
I don't think EncodeDecodeLLSRQ was designed to do what you're looking for but it might just work. For example, when entering an incomplete city name, the service will return a list of possible values.
RQ:
<CityName>MONTEV</CityName>
RS:
<Text>MVD MONTEVIDEO, URUGUAY</Text>
<Text>MVE MONTEVIDEO MN, MINNESOTA,USA</Text>
<Text>FMV MONTEVIDEO FLUVIA, URUGUAY</Text>
<Text>VDT MONTEVIDEO TC BUS, URUGUAY</Text>
Do you have access to SOAP API? If so, could you please share the complete RQ to see if there's something wrong there?
I'm trying to create load testing scenario with tsung. I need to use 2 types of session: ts_jabber and ts_http. May I continue use Jabber session after HTTP switching to and back?
This is my code:
<sessions>
<session probability="100" name="session1" type="ts_http">
//some code
<change_type new_type="ts_jabber" host="*****" port="5222" server_type="tcp" store = "true"/>
<request subst="true">
<jabber type="connect" ack="local">
<xmpp_authenticate username="%%_loginForChat%%" passwd="%%_password%%"/>
</jabber>
</request>
<thinktime value="10"></thinktime>
<transaction name="authenticate">
<request>
<jabber type="auth_sasl" ack="local"></jabber></request>
<request>
<jabber type="connect" ack="local"></jabber> </request>
<request>
<jabber type="auth_sasl_bind" ack="local" ></jabber></request>
<request>
<jabber type="auth_sasl_session" ack="local" ></jabber></request>
</transaction>
<change_type new_type="ts_http" host="******" port="80" server_type="tcp"
//some code
<change_type new_type="ts_jabber" host="*******" port="5222" server_type="tcp" />
<request subst="true">
<jabber type="muc:join" ack="local" room="%%_app_id%%_%%_groupChat_room_id%%" nick="%%_loginForChat%%"/>
</request>
</session>
After run this code i get an error: "Error: Unknown msg {tcp_closed, #Port<0.1183>} receive in state wait_ack, stop"
Help me, please.
I have a groovy script that generates an RSS feed that I am attempting to write to ${app.home} /rss using a file endpoint.
I am then serving up this RSS feed as a static resource via an http endpoint.
<flow name="rssModifier" doc:name="rssModifier">
<quartz:inbound-endpoint jobName="job" repeatInterval="300000" responseTimeout="10000" doc:name="Quartz">
<quartz:event-generator-job/>
</quartz:inbound-endpoint>
<all doc:name="All">
<processor-chain>
<scripting:component doc:name="FirstGroovyRssFeed">
<scripting:script engine="Groovy" file="C:\git-gms\edus-esb-rss-test-harness\src\main\java\edu\ucdavis\iet\edus\rsstestharness\server\groovy\InitializeRssFeed.groovy"/>
</scripting:component>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<file:outbound-endpoint path="${app.home}/rss/groovy.xml" responseTimeout="10000" doc:name="File"/>
</processor-chain>
</all>
</flow>
<flow name="httpWebServer" doc:name="httpWebServer">
<http:inbound-endpoint address="http://localhost:8084/static" doc:name="HTTP" exchange-pattern="request-response" connector-ref="HTTP_HTTPS"/>
<http:static-resource-handler resourceBase="${app.home}/rss"
defaultFile="rometest.xml" doc:name="HTTP Static Resource Handler"/>
<logger message="#[payload] #[message]" level="INFO" doc:name="Logger"/>
</flow>
I've confirmed that the groovy.xml file exists in the ${app.home} directory when this application is run, but I am getting the following error, and the rss feed xml is not being written to the file:
Message : Streaming failed. Could not get output stream. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=file:///C:/Users/gmsharpe/MuleStudio/workspace-3.5/.mule/apps/edus-esb-rss-test-harness/rss/groovy.xml, connector=FileConnector
{
name=output
lifecycle=start
this=353ccb63
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[file]
serviceOverrides=<none>
}
, name='endpoint..C.Users.gmsharpe.MuleStudio.workspace.3.5.mule.apps.edus.esb.rss.test.harness.rss.groovy.xml', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: String
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. The system cannot find the path specified (java.io.IOException)
java.io.WinNTFileSystem:-2 (null)
2. Streaming failed. Could not get output stream. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=file:///C:/Users/gmsharpe/MuleStudio/workspace-3.5/.mule/apps/edus-esb-rss-test-harness/rss/groovy.xml, connector=FileConnector
{
name=output
lifecycle=start
this=353ccb63
numberOfConcurrentTransactedReceivers=4
createMultipleTransactedReceivers=true
connected=true
supportedProtocols=[file]
serviceOverrides=<none>
}
, name='endpoint..C.Users.gmsharpe.MuleStudio.workspace.3.5.mule.apps.edus.esb.rss.test.harness.rss.groovy.xml', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: String (org.mule.api.transport.DispatchException)
org.mule.transport.file.FileConnector:569 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at org.mule.util.FileUtils.createFile(FileUtils.java:93)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
I figured out what I was doing wrong. I needed to define only the directory path for the file outbound endpoint. I also needed a file connector that was defined as follows:
<file:connector name="output" autoDelete="false" outputAppend="true" outputPattern="groovy.xml" streaming="false" validateConnections="true" doc:name="File"/>
File connector is configured to allow appending to an existing file if present and defines the name of the file via the 'outputPattern' attribute.