I would like to ask how can I start another flow using quartz.
Starting each flow seperately (one is trigered with IMAP and second with Quartz) works ok, but I would like to have both of them in same file if possible, or at least in same project. I don't know what is good practice for this so I let you decide.
So, Flow1 starts with IMAP and do its job with mail (original) and then goes on to other subflows.
Flow2 starts with quartz and do its job (the one I would like to add)
Both flows have same variables and have similar job but don't have to be sinchronized of course.
Now, how can I achieve this?
I tried this:
<flow name="Flow1" doc:name="Flow1">
<imaps:inbound-endpoint doc:name="IMAP"
host="imap.gmail.com" port="993" responseTimeout="10000"
........
</flow>
<flow name="Flow2" doc:name="Flow2">
<quartz:outbound-endpoint jobName="FlowStarter" repeatInterval="10000" responseTimeout="10000" doc:name="Quartz">
<quartz:event-generator-job groupName="QuartzGenGroup" jobGroupName="QuartzGenGroup">
<quartz:payload>wwqda</quartz:payload>
</quartz:event-generator-job>
</quartz:outbound-endpoint>
<logger message="Quartz started at #[server.dateTime.toCalendar().toString()] #[payload]" level="INFO" doc:name="Logger"/>
</flow>
When I started this, Flow2 never gave any output.
I am using Mule Studio 3.5.0
Thank you!
In the Flow 2 use quartz:inbound-endpoint instead of quartz:outbound-endpoint. Outbound endpoint does not trigger workflow itself. It requires an additional incoming event.
Look at http://2rdscreenretargeting.blogspot.ru/2012/12/how-to-schedule-jobs-using-mule-studio.html for details on Quartz usage in Mule.
Related
I have a perplexing issue. I have Web Service A (henceforth WSA), a 3.5 .Net WCF, which I have added a call to Web Service B (henceforth WSB) which is a 3.5 .Net ASMX. When running WSA in the client (SOAPUI or WCFStorm), the WSB call times out per the client timeout setting.
In the VS event viewer I can see that the call to WSB immediately throws two error 400s:
Exception thrown: 'System.Net.WebException' in System.dll ("The remote
server returned an error: (400) Bad Request."). Exception thrown:
'System.Net.WebException' in System.dll ("The remote server returned
an error: (400) Bad Request.")
No reason is given. What is just as puzzling to me is the error doesn't go to my catch. When I debug and I hit the line of code that calls WSB, it's like a reset. No further code gets executed and no error is thrown by my WSA.
If I call WSB directly, it works. So nothing is wrong with WSB. At suggestion of a coworker, I took the code specific to my change and put it in a stand-alone service. I literally C&P the code and configs setting specific to me and adjust namespaces and class names. Lo and behold it works. My stand-alone web service called WSB just fine and get the data I expect.
A coworker and I checked the logs (IIS log for the service and the HTTPERR log) on the IIS server that WSB resides on to see if there was any mention of the 400 error. We found none.
So we are kind of perplexed at this point. The only thing we can think of is perhaps something in the web config might be interfering but have no idea what it could be.
If you have any suggestions of where else to look that would be helpful.
And it would be nice to know why it isn't falling into my error handler.
Thanks.
Update: It was requested I add config and code. I don't think it will help honestly and it is pretty straightforward. I can't put the real code due to company reasons but it is basically this:
In web config:
<configuration>
<appSettings>
<add key="endpointUrl" value = "someurl" />
</appSettings>
.
.
.
<applicationSettings>
<MyService.Properties.Settings>
<setting name="MyService_TheirService"
serializeAs="String">
<value>someurl</value>
</setting>
</MyService.Properties.Settings>
</applicationSettings>
Even though the data is super small I did try making large reader settings and such:
<binding name="CustomHtttpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="01:50:00" openTimeout="01:50:00" sendTimeout="01:50:00" receiveTimeout="01:50:00" >
<readerQuotas maxDepth="128"
maxStringContentLength="8388608"
maxArrayLength="2147483646"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
</binding>
Code:
using MyService.TheirService
.
.
.
var theirURL = ConfigurationManager.AppSettings["endpointUrl"];
var oSvc = new TheirServiceObject
{
Url = theirURL
};
int numberIneed = oSvc.SomeMethod();
That last line is where it throws the 400.
UPDATE 2:
A colleague show me how to use Fiddler. And I can now see that the request to WSB is absolute garbage.
xڭ s 6 mr!!u \ .3 5'3 G QOH>Iп kX M3 ~vY ) X e Z
w ~ :jv -ݴwڽHb Yqv A :(Q Z; >9W O0g 6 .ɖVlU Ţ 8Z
< ( t eSv U]r R $N \
Some odd encoding? At least it's another clue.
Wanted to let you know this problem was solved. Another Dev that had worked on this service before but no longer just happened to walk by and I said "Hey! Look at this!"
They saw the garbage request data and said "That looks like compression. Look up compression in the project."
Turn out there was a custom compression component that was compressing the outgoing data of the service and you needed to add 2 lines of code to decompress. After adding those lines to the top of my method everything immediately worked.
The lesson here is if your project is doing some weird stuff that defies reason, try and find as many people as you can that worked on it before even if they aren't working on it anymore.
In the notification document (link below) the examples for Notification Configurations, it explains that configurations with overlapping prefix/suffix combinations are invalid.
Notification How To
However, there aren't any details for a way to catch any unspecified prefixes. If I had an S3 bucket with the directories dir1/ and dir2/, with a notification configuration like:
<NotificationConfiguration>
<TopicConfiguration>
<Topic>arn:aws:sns:us-east-1:123412341234:sns-notify-dir1</Topic>
<Event>s3:ObjectCreated:*</Event>
<Filter>
<S3Key>
<FilterRule>
<Name>prefix</Name>
<Value>dir1</Value>
</FilterRule>
</S3Key>
</Filter>
</TopicConfiguration>
<TopicConfiguration>
<Topic>arn:aws:sns:us-east-1:123412341234:sns-notify-dir2</Topic>
<Event>s3:ObjectCreated:*</Event>
<Filter>
<S3Key>
<FilterRule>
<Name>prefix</Name>
<Value>dir2</Value>
</FilterRule>
</S3Key>
</Filter>
</TopicConfiguration>
</NotificationConfiguration>
Is it possible to add a catchall filter? I know that overlapping rules don't work, so I can't just add:
<TopicConfiguration>
<Topic>arn:aws:sns:us-east-1:123412341234:sns-notify-generic</Topic>
<Event>s3:ObjectCreated:*</Event>
</TopicConfiguration>
I'd like to know if I can have a more generic SNS notification in the event that an object is added under a 3rd directory, or in no directory, while still handling the first two cases specifically. Specifically, I'd like a filter that only catches things that haven't already been filtered, though I would also be happy with the ability to send multiple notifications (such as sending sns-notify-dir1 and sns-notify-generic for dir1, but just sns-notify-generic for dir3).
dir1/ -> Handled by sns-notify-dir1
dir2/ -> Handled by sns-notify-dir2
/ -> How can I handle with sns-notify-generic?
dir3/ -> How can I handle with sns-notify-generic?
I realize that alternative solutions will work, such as only writing a generic SNS and having my utilities sort out whether to listen to it, as well as sending everything to a lambda function to sort out which notification to trigger. However, I like the idea of coding this as cleanly as possible, if it is possible.
Please let me know if additional details would help, and thank you!
We have a situation where a Liberty application accesses a custom resource adapter through a JNDI lookup to a connection factory, defined in the server.xml. The combination of the connectionFactory, resourceAdapter, and enterpriseApplication nodes in the server.xml appears to make it impossible to bundle the rar inside the ear and push an ear as a single entity without major app refactoring, which is a non-starter.
I see two options for getting around this right now:
Push the rar/ear combo as a bundled server package, or
Modify the Liberty buildpack to pull in the rar at push time, generating the expected nodes in the server.xml
Am I missing a third option?
Thanks, Tom
The third option would be to embed the RAR in your app, but I didn't understand your comment about why that would require extensive app refactoring. In theory, the app shouldn't change, just the config...
See the IBM Knowledge Center topic http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_jca_config_resadapters.html?lang=en for details on configuring a connection factory for use with an embedded resource adapter.
For the standalone resource adapter, I assume you had something like this in server.xml:
<connectionFactory jndiName="eis/NAME" type="javax.resource.cci.ConnectionFactory">
<properties.rarName dataStoreName="name" hostName="otherName"/>
</connectionFactory>
<resourceAdapter id="rarName" location="rarName.rar"/>
when you embed the rar in the ear, as you noted, that resourceAdapter node goes away and instead you would use something like this:
<application location="C:/applications/app1.ear"/>
<connectionFactory jndiName="eis/NAME” type='javax.resource.cci.ConnectionFactory’>
<properties.app1.rarName dataStoreName="name" hostName="otherName"/>
</connectionFactory>
Note that for an embedded resource adapter, the properties element must now also include the application name (in this case “app1”) in the name of the element.
As indicated in the Knowledge Center topic, if you wanted to override the default name of the resource adapter, you could instead do:
<application location="C:/applications/app1.ear”>
<resourceAdapter id=“rarName" alias="MyEmbeddedRA"/>
</application>
<connectionFactory jndiName="eis/NAME" type="javax.resource.cci.ConnectionFactory">
<properties.app1.MyEmbeddedRA dataStoreName="name" hostName="otherName"/>
</connectionFactory>
I have a Icecast2 (2.4.1) setup working, users connect to /live and listens to my rotation. Now I want to have another "mount point" so I can go live and back to rotation.
I haven't found a guide or help I could understand so far.
What you are looking for are "fallbacks".
The documentation describes them.
Basically you would have a transition like this:
/live.ogg
↓ (↑)
/rotation.ogg
If /live.ogg disconnects, all listeners are transferred to /rotation.ogg. New listeners connecting to /live.ogg are directly served the /rotation.ogg stream.
If fallback-override is set, then the arrow in brackets becomes relevant:
If /live.ogg reconnects, all listeners are transferred back from /rotation.ogg to /live.ogg.
Otherwise all listeners remain on /rotation.ogg and only new listeners are served /live.ogg.
In terms of config it would look something like this (only relevant parts are included):
<mount>
<mount-name>/live.ogg</mount-name>
<fallback-mount>/rotation.ogg</fallback-mount>
<fallback-override>1</fallback-override>
</mount>
<mount>
<mount-name>/rotation.ogg</mount-name>
</mount>
I'm using wso2 bps 2.1.2 for running simple bpel process with tree invokes called one by one in loop. The loop is around one hundred times. Problem is that sometimes process hang in running state. In logs I get error:
[2013-03-25 14:44:17,897] ERROR - BpelEngineImpl - Scheduled job failed; jobDetail=JobDetails( instanceId: 14109433 mexId: null processId: null type: TIMER channel: 11513 correlatorId: null correlationKeySet: null retryCount: null inMem: false detailsExt: {})
java.lang.IllegalArgumentException: No such channel; id=11513
at org.apache.ode.jacob.vpu.ExecutionQueueImpl.findChannelFrame(ExecutionQueueImpl.java:205)
at org.apache.ode.jacob.vpu.ExecutionQueueImpl.consumeExport(ExecutionQueueImpl.java:232)
at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.importChannel(JacobVPU.java:369)
at org.apache.ode.jacob.JacobObject.importChannel(JacobObject.java:47)
at org.apache.ode.bpel.engine.BpelRuntimeContextImpl$5.run(BpelRuntimeContextImpl.java:964)
at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.ode.jacob.vpu.JacobVPU$JacobThreadImpl.run(JacobVPU.java:451)
at org.apache.ode.jacob.vpu.JacobVPU.execute(JacobVPU.java:139)
at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.execute(BpelRuntimeContextImpl.java:879)
at org.apache.ode.bpel.engine.BpelRuntimeContextImpl.timerEvent(BpelRuntimeContextImpl.java:968)
at org.apache.ode.bpel.engine.BpelProcess.handleJobDetails(BpelProcess.java:478)
at org.apache.ode.bpel.engine.BpelEngineImpl.onScheduledJob(BpelEngineImpl.java:560)
at org.apache.ode.bpel.engine.BpelServerImpl.onScheduledJob(BpelServerImpl.java:445)
at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleScheduler.java:537)
at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob$1.call(SimpleScheduler.java:531)
at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:284)
at org.apache.ode.scheduler.simple.SimpleScheduler.execTransaction(SimpleScheduler.java:239)
at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:531)
at org.apache.ode.scheduler.simple.SimpleScheduler$RunJob.call(SimpleScheduler.java:515)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
at java.util.concurrent.FutureTask.run(FutureTask.java:149)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:738)
I can't find any useful information about this error. I'm using oracle database. I tried to modify bps.xml with:
<tns:OpenJPAConfig>
<tns:property name="openjpa.FlushBeforeQueries" value="true"/>
<!-- added this line as for https://wso2.org/jira/browse/CARBON-7500 (use also Oracle 11g Driver!!) -->
<tns:property name="openjpa.jdbc.DBDictionary" value="oracle(batchLimit=0)"/>
</tns:OpenJPAConfig>
But this didn't help.
Process is really simple it look like this:
<forEach counterName="count" parallel="no" >
< doXslTransform …>
<wait 1s>
<invoke ...>
<doXslTransform …>
<wait 1s>
<invoke ...>
< doXslTransform …>
<wait 1s>
<invoke ...>
</forEach>
How can I solve “No such channel” errors?
Thanks Tomek
We identified one issue that was causing this problem and fixed it. It was due to a missing process instance lock in the ode run-time embedded within BPS. We found this issue and fixed it.
https://issues.apache.org/jira/browse/ODE-989
https://wso2.org/jira/browse/BPS-218
If you can attach your sample scenario to the jira, it would help us add another test case. The fix is already available in the trunk and will be available in the next release.
Regards
Nandika
I had remove waits from process and everything start working without problems. It seems that there is some bug in < wait > activity in WSO2 BPS 2.1.2. In BPS 3.0.0 it seams that waits are working.