Chandra Bhatt

Ranch Hand
+ Follow
since Feb 28, 2007
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
6
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chandra Bhatt

Yes. Good catch.
Any idea on the implementation logic ?
Thank you!
8 years ago
carey,

Basically I have input as series of user actions (which all screens of a web page user has visited) e.g. each input line represent individual user's page views.
I want to create a Behavior flow out of it. for example Screen1 is viewed by 2 people followed by Screen2 by 2 people followed by Screen3 by 2 people and so on.
If someone visits Screen4 after Screen2 the output should be Sceen1,2 -> Screen2,2 -> Screen4,1
Value right after Screen name is number of times that screen was viewed by someone.
Hope I am making sense here in the requirement.
8 years ago
Hi all,

I am looking for building logic in Java for screen flow consolidation. Sample for input and output is below. Can you please suggest what data structure fits best for this scenario.
I was able to build a logic to count screen watch at each level but still thinking over how to come to exact desirable output. Any idea would be appreciated.

Input:
screen1,screen2,screen3,screen4
screen3,screen4,screen5,screen8
screen9,screen2,screen3,screen9,screen10
screen9,screen10,screen11,screen12
screen3,screen4,screen5,screen8
screen3,screen4,screen5,screen8
screen1,screen2,screen3,screen4

Output:
Screen1,2 -> Screen2,2 -> Screen3,2 -> Screen4,4
Screen3,3 -> Screen4,3 -> Screen5,3 -> Screen8,3
Screen9,2, -> Screen2,1 -> Screen3,1 -> Screen9,1 -> Screen10,1
Screen9,1, -> Screen10,1 -> Screen11,1 -> Screen12


Thanks
CM
8 years ago

Steve Luke wrote:And if it is null or blank, what happens to the Stream? If you try to read from it does it hang waiting for input, or does it output end-of-stream?



I run the same piece of code from main passing null and blank and got following error:




BTW, In logs I see below line in abundance. May be this gives some clue.

19:34:05,056 SEVERE [com.sun.xml.messaging.saaj.soap] (pool-14021-thread-2) SAAJ0601.util.newSAXParser.exception

Steve Luke wrote:
Is there any chance that could produce an empty Stream?



thanks for sharing idea.

If your question is if authRespone can be null or blank? Yes it can be.
I posted the method definition of createXMLSrt in below thread. Basically we are making HTTP connection using Apache HttpClient to remote server, getting SOAP response and processing that:


remoteCallResponse = createXMLStr(IOUtils.toString(post.getResponseBodyAsStream(), "UTF-8"));

My suspect is on below piece of code, specially processing SOAP response:

We migrated to JBoss 7.1 recently from JBoss 5.1. JVM gets hung in every couple days and stops accepting any requests. We need to restart to get it back to service. It happens when the total thread utilization goes beyond 6-7K. We take thread dump and find majority of threads (90% of threads) stack traces look like this. Not sure what's going on.
This issue was not there when we were on JBoss 5.1. Any clue/help is appreciated.


"pool-696505-thread-3" prio=10 tid=0x0000000062b08000 nid=0x6c57 waiting on condition [0x0000000078bfc000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007038b3400> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:315)
at com.sun.xml.messaging.saaj.util.ParserPool.get(ParserPool.java:88)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:91)
at com.sun.xml.messaging.saaj.soap.ver1_2.SOAPPart1_2Impl.createEnvelopeFromSource(SOAPPart1_2Impl.java:84)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:143)
at com.abc.myproject.integrator.uib.UnifiedMessagingIntegrator.createXMLStr(UnifiedMessagingIntegrator.java:425)
at com.abc.myproject.integrator.uib.UnifiedMessagingIntegrator.makeRemoteSystemsCall(UnifiedMessagingIntegrator.java:650)
at com.abc.myproject.integrator.RemoteRequestDispatcherConcurrent.call(RemoteRequestDispatcherConcurrent.java:69)
at com.abc.myproject.integrator.RemoteRequestDispatcherConcurrent.call(RemoteRequestDispatcherConcurrent.java:56)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)


"pool-696504-thread-3" prio=10 tid=0x00002aaad5d72000 nid=0x6c52 waiting on condition [0x0000000078b57000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007038b3400> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:315)
at com.sun.xml.messaging.saaj.util.ParserPool.get(ParserPool.java:88)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:91)
at com.sun.xml.messaging.saaj.soap.ver1_2.SOAPPart1_2Impl.createEnvelopeFromSource(SOAPPart1_2Impl.java:84)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:143)
at com.abc.myproject.integrator.uib.UnifiedMessagingIntegrator.createXMLStr(UnifiedMessagingIntegrator.java:425)
at com.abc.myproject.integrator.uib.UnifiedMessagingIntegrator.makeRemoteSystemsCall(UnifiedMessagingIntegrator.java:650)
at com.abc.myproject.integrator.RemoteRequestDispatcherConcurrent.call(RemoteRequestDispatcherConcurrent.java:69)
at com.abc.myproject.integrator.RemoteRequestDispatcherConcurrent.call(RemoteRequestDispatcherConcurrent.java:56)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
We use JBoss 5.1 application server. My application server is running into high load. We push thousands of messages into JMS queue.

Its goes into situation where I see huge difference between Message count Vs Delivery count of the messages.

below is what i am seeing under jboss.messaging.destination of my specific queue in jmx-console:

MessageCount R int The number of messages in the queue 113430
DeliveringCount R int The number of messages currently being delivered 232

ConsumerCount is always 5.

The problem I am facing is the huge delay in delivery of individual messages. Basically once MDB is invoked to process one message and we make a HTTP connection to send that message to some external server. Looks like thousands of messages are never delivered, chocking in JMS queue.

When i restart the servers, for sometime it the messageCount and deliveringCount stays same for some time the difference goes on increasing. Looks like production of messages is more than the amount that can be consumed.

It has got performance issue as well, huge increase in CPU and Heap utilization.

Do we need to increase the cosumer count, if yes where is the configuration.

Any help will be very much appreciated.

Thanks!
Hi All,

Please see below method. We call this method whenever we need to make an http connection to remote server. Is this approach correct. Do we need to make MultiThreadedConnectionManager and related configuration out of this method and keep its scope application level instead of per method call level?

Please throw some input on this.



Thanks in advance.
Thanks Henry.. It did help me. I was able to do using ByteBuffer.
Thanks a lot.


14 years ago

Henry Wong wrote:

Chandra Bhatt wrote:Any idea on this please




On what? Are you asking if the pipe stream can handle this? or is asking another question, like how to package the bytes?

Henry




My question is on how to package the bytes. Or in other words how to get streamed of tokens for my application, say Output stream containing tokens.
Bare with this, if I am asking something trivial to do. Not sure though.
14 years ago
Any idea on this please
14 years ago
This is the data I want to put in and then convert to byte stream
{time_t = 1268360515647
sizeof the token (2 bytes)
token data = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdddd"}


It is difficult to get the real data stream for testing my application, as it only comes from the production environment. I wanted to have such simulated stream for testing
purpose.

Here I need dummy/simulated replacement for socket.getInputStream()...
So wanted to create a stream of tokens with appropriated values and test my this method which actually parses/tokenizes/extracts the data:




Thanks
14 years ago