Anish Kuti

Greenhorn
+ Follow
since May 12, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anish Kuti

I am using stored procedure and inside that a cursor will return data to my Ibatis Layer.
Now I have see in some cases the data size is huge (1lakh) . My JVM will not be able to hold that size of data .
How i can set a Max size of data using ibatis ? say I will just return only first 1000 row , no more than that .

Note:I know it can be using by changing SP , but is anything can be done in Ibatis layer to ask my procedure to return only 1000 row.
In my application Mule (v2.2.1) is listing to WMQ and we have defined 10 consumer for the Mule connector.
We have implemented retry policy also as below .
So 10 consumer is listing the queue and now due to some unwanted reason some consumer are getting disconnected , due to that huge backlog is getting created in MQ.
We want - if any consumer is getting disconnected i.e if consumer number <10 then MULE should retry and will get 10 consumer. how could we do that ?
In our case when all the consumer is getting down then only MULE is retrying i.e retrying only in case of connector down .
we want retry in case of consumer is down also.

Spring Config:
<bean id="threadingPolicyTemplate"
class="com.test.platform.mule.mqpolicies.async.AsynchronousRetryTemplate">
<constructor-arg index="0">
<bean class="com.test.platform.mule.mqpolicies.policies.SimpleRetryPolicyTemplate">
<constructor-arg index="0" value="15000"/>
<constructor-arg index="1" value="1"/>
</bean>
</constructor-arg>
</bean>

Java Class:
import java.util.Map;

import javax.resource.spi.work.WorkException;

import org.mule.api.context.WorkManager;
import org.mule.api.retry.RetryCallback;
import org.mule.api.retry.RetryContext;
import org.mule.api.retry.RetryNotifier;
import org.mule.api.retry.RetryPolicy;
import org.mule.api.retry.RetryPolicyTemplate;
import org.mule.retry.RetryPolicyExhaustedException;
import org.mule.util.concurrent.Latch;

import com.test.platform.mule.mqpolicies.policies.RetryForeverPolicyTemplate;

/**
* The Class AsynchronousRetryTemplate.
*/
public class AsynchronousRetryTemplate implements RetryPolicyTemplate {
/** The Constant RETRY_TEMPLTE_300000. */
private static final String RETRY_TEMPLTE_300000 = "300000";

/** The delegate. */
private final RetryPolicyTemplate delegate;

/** The start latch. */
private Latch startLatch;

/**
* Instantiates a new asynchronous retry template.
*
* @param delegate the delegate
*/
public AsynchronousRetryTemplate(RetryPolicyTemplate delegate) {
this.delegate = delegate;
}

/**
* Execute.
*
* @param callback the callback
* @param workManager the work manager
*
* @return the retry context
*
* @throws Exception the exception
*/
public RetryContext execute(RetryCallback callback, WorkManager workManager)
throws Exception {
RetryWorker worker = new RetryWorker(this.delegate, callback, workManager, this.startLatch);
FutureRetryContext context = worker.getRetryContext();

try {
System.out.println("After Inside sync block****");
workManager.doWork(worker);
System.out.println("After Do Work" + context.isOk());
} catch (Exception e) {
e.printStackTrace();
System.out.println("****Inside Exception block****");

try {
RetryPolicyTemplate delegateForever = new RetryForeverPolicyTemplate(Long.parseLong(RETRY_TEMPLTE_300000));
RetryWorker workerTemp = new RetryWorker(delegateForever, callback, workManager, this.startLatch);
FutureRetryContext contextTemp = workerTemp.getRetryContext();
System.out.println("Inside Async block****");
workManager.scheduleWork(workerTemp);

return contextTemp;
} catch (WorkException w) {
throw new RetryPolicyExhaustedException(w, null);
}
}

return context;
}
Mule Config:
<jms:connector name="mqConnector"
specification="1.0.2b"
jndiInitialFactory="com.sun.jndi.fscontext.RefFSContextFactory"
jndiProviderUrl="file:///mqlocal/home/mqm/jmsadmin/Jndi"
connectionFactoryJndiName="TestApp"
numberOfConsumers="10">
<spring:property name="retryPolicyTemplate" ref="threadingPolicyTemplate" />
<spring:property name="jmsSupport" ref="customJmsSupport" />
</jms:connector>
12 years ago
Many Thanks Rajesh.
Business wants the high priority message to read first . Is there any way we can ensure the top priority msg read first .
12 years ago
Hi ,
I am using weblogic 9.2 MP3.
I am sending message(xml) to JMS queue with different priority. I want the highest priority msg to be picked first by consumer.

What I am doing -
1. Currently No consumer is listening ,so that all the message get stuck in JMS queue
2. Then I am posting xmls in JMS queue with default priority(4) first
3. Then posting few xml with Priority 9.

Now I am reading the JMS queue using java client but I am NOT getting the priority 9 message first .
Rather I am getting the message in FIFO order.

12 years ago
Frank ,
Thanks for your reply.

but if a xpath is like /a/b[c="anish"]/d or /a/b[c="kuti"]/d[e=/p/q/[r="some"]/s]/f


then I have to create the xml instance document by looking the value of C in first case and in the 2 nd case c,r .. which will might be complicated ..


Is there any simple and straight forward way out to solve this ?
Hi Paul,
Apologies not for making this clear.
I want to
"only have the schema and don't have any XML documents which conform to it. So want to find out if the expression would be "valid" (whatever that means) with respect to all possible XML documents which conform to the schema "

Please let me know if there is any way forward?
We need to validate a xpath using XSD not using sample XML generated from XSD.

Is there any way out ?

why I am saying is .. some XPATH will be based on some value .. which will not be present in sample XML like
like /a/b[c="anish"]/d
Thanks for your help !! .. I will try this and let you know it works..

"Just curious though, why would you not settle on one XSLT transformer within a single JVM? "
.. .. actually we were testing two application in a Development env and it has only one JVM..it would not happen in case of production.
14 years ago
I don't know whether I have understand your question correctly or not ..
But this would be same as normal java programming technique .. You need to put exception handling for the any piece of code you will write down..
I don't see any special things you need to do here ..
14 years ago
In your case I believe the best suited parser will be JaxMe2 . as all the data in the xml are Database data..
14 years ago
JrockIt Mission controle is also a good tool
14 years ago
if the checking the duplicates and removing them is costly in your case .another alternative is to pass the whole records to data base(insert the records in data base using addbatch) and then invoking another procedure in database which will do this kind of duplication chcek and removal of duplicates .
I believe the number of records to be handled ,will not create any performance problem in Database front.
14 years ago
In my weblogic domain , 2 application is deployed .

1st Application - has a code which do XSLT transformation using XALAN .For this below preference is set in code
system.setproperty("javax.xml.transform.TransformerFactory" ,"org.apache.xalan.processor.TransformerFactoryImpl")

2nd Application - has code which has XSLT tranformer .. but it does not use XALAN .. it use simple SUN java transformer.

But when we deployed the both application in the same weblogic domains .. it does conflict.. 2 nd application ask for XALAN transformer to set .. which is not required for this 2 nd application .. How to solve this kind of conflict ? Any help will be appreciated.
14 years ago
i want to update XMl doc ..specifically the namespace .

<?xml version="1.0" encoding="UTF-8"?>
<storage:Root xmlns:pic="http://www.pic.com/schema/132/lonm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.pic.com/schema/132/lonm">
<Employee>
<Name>Arabind</Name>
</Employee>
</Root>

How can I update this xml namespace using JAXP or XMLbean(preferable ) or any dom
xmlns:pic="http://www.pic.com/schema/132/lonm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.pic.com/schema/132/lonm"
with
xmlns:pic="http://www.pic.com/schema/133/lonm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.pic.com/schema/133/lonm"


Please help ..
15 years ago
Exiting application is using XMLBEAN for manipulating XML document.
Current Requirement one method which will update the XML , but the twist is the input of the method will be a xpath [like as /a/b/c[1]/d] and a value.
Now the method should update the element with the given value or if the element is not in the xml ,it needs to be inserted with the value.

Is there any method/api in Xmlbean which can take input as xpath and value.. and it will do modification in the XML.?
Please help ?