Reconnection for asynchronous consumer
Hello,
I have a connection with only an asynchronous consumer and a JMS ExceptionListener on it. When I pull out the network cable on the client for 10 minutes or so (long enough for the server to close the connection), then plug it back in, my consumer never receives a message again. There is no exception received by the listener. It doesn't seem to matter if my reconnect settings are infinite or not.
If I put producers on the connection, the connection is re-established (or the JMSExceptionListener receives an exception) and everything is fine.
I need to be able to detect the fact that there is a problem. Should I be making synchronous receive calls instead? What about a dummy producer on the connection?
Thanks,
Aaron
Aron,
I guess, you are facing here 'half open connection' problem.
There is already bug filed regarding this and the fix will be available within MQ3.6 timeline.
Bug description is,
"We're doing some reliability/stress testing that involves periodically disabling/re-enabling network interfaces. Every once in a while we end up with a half open connection between the MQ client and broker--the client thinks the connection is up, but the broker has closed it. The client detects that the connection is down when it tries to publish, but if it's only a subscriber, then
it never knows the connection went away. The broker has a mechanism that pings the client-side periodically to prevent this situation, but there doesn't appear to a similar mechanism on the client side.
Ideally, the client's ExceptionListener.onException method should be called when the connection is detected to be (half-)closed."
Workaround suggested is,
" To generate traffic between the client and the broker by creating a session and closing it or creating a temporary destination and deleting it. This will trigger the Exception."
Hope this helps.
Thanks.
Sagar
http://wwws.sun.com/software/products/message_queue
Similar Messages
-
Best option for Asynchronous method invocation? JMS or Pure Java Thread
Hi,
We've a swing based Client application which is supposed to run with a server in J2EE environment. Some process like Search etc are very time consuming. So we are going for asynchronous process.
Now the question is to find a best option for this. Two possible candidates are
1. JMS
2. Java Thread.
Can anybody suggest me which one is the best option in this context?Actually my thought was the issues with code maintainability.Maintainability is different issue, it is much related to OOAD and design pattern you might want to choose to avoid coupling (thus high reusability and maintainability - eg: for future enhancement, etc)..
public interface SearchService {
public static class DefaultFactory {
public SearchService getInstance() {
return HttpSearchService.getInstance();
public void search (String[] keywords, Observer obs);
public class HttpSearchService implements SearchService {
public static HttpSearchService getInstance() {
... bla bla bla singleton ...
public void search(final String [] keywords, final Observer obs) {
(new Thread() {
public void run() {
.. do http request ...
List result = ... parse http response ...
obs.update(list);
}).start();
SearchService ss = SearchService.DefaultFactory.getInstance();
ss.search( new String[] { "get", "me", "my" , "dukes" }, myTableModel );
...You can, in future, replace the default factory HttpSearchService with something faster, more appropriate SearchService, without changing many codes.
rgds,
Alex -
Asynchronous Consumer Message Size Limitation?
Hello,
We are currently evaluating the Sun Message Queue 3.5. We are able to successfully send and asynchronously receive messages that are less than 1K. However, when we increased the size of the message to 2K or more, the asynchronous consumer does not return the message and messages that we send subsequently (large or small) do not get received. Seems like the destination is blocked at that point. We are able to retrieve the message synchronously though using the receive(1000) method.
Is there maybe a setting that we must check out for this?
Also, is it possible to support both synchronous and asynchronous messaging at the same time?
ie. Creating MessageListeners and also using the receive method for the same set of destinations?
We were planning to use this as a workaround so that if the message is greater that 1K, we'll just receive it synchronously. However, synchronous receiving doesn't seem to work if there is a listener listening to a destination that contains a large message.
Thanks for your time.Outside of specific configurable parameters, nothing in
the system really cares about the size of the message.
A few possible reasons:
1. if you are using receive(timeout), the receive time may
be too short to complete processing the message (since
larger messages take longer to send over the network)
2. if you are setting an expiration time, the larger messages
could be expiring during the routing stage (since the
messages take longer)
3. The larger messages could be exceeding a configured
size limit on either the destination or broker
To check:
imqcmd query dst -n <name> -t t
or
imqcmd query bkr
And look at the size limits
If the size limits are exceeded, the messages will be rejected.
Additionally, if -
PR, PO, GR for a consumable material without material master record
Hi,
I have created a complete cylcle till Invoice Verification for a material without a material master record.
But i have one query i.e. in the cylce i created i had to create a GR before entering MIRO. Is there any way by which i need not create a GR for a consumable material i.e. to be posted directly to a GL without any inventory management.
In my case, the GR checkbox in the PO was automatically ticked.
Can anyone help on this please.
Regards,
LaxmiCustomizing Error Message in ME23N
When displaying of modifying Purchase Orders with a document type of Framework Order, a user selects the LIMITS tab, they get the error message Customizing incorrectly maintained, message number SE729.
The problem is caused by version upgrades of the SAP software.
Number of entries in table T162V is different to the number of columns in table control for screen SAPLMLSP (400). You can use screen painter SE51 to display the screen. View the Element list for TC_VIEW.
The list of fields can also be viewed within the program. Transaction code ML81N (service entry sheet), program SAPLMLSR. Click on the Configuration button (top right hand corner) select Administrator. This shows the number of fields as 67.
Using SE16N to view table T162V shows 69 fields. This table contains six layouts (variants), they must all be the same. Before the change the total count was 414 (69 x 6).
The ME23N transaction only checks that the number of entries is correct. You will notice that the fields are not in the same sequence, but that should not matter if you donot use the service transaction ML81N and it is not a selectable tab on ME23N.
Transaction SM31 was used to delete the extra fields. As this is a SAP table, you may need extra authorisations to make the change.
Note: the number of fields shown above will be different in each site. This is because of different SAP versions and in what software is loaded. -
My HP (USB connected) and Epson (wireless) printers keep losing their connection with my Mac mini. I have to physically disconnect the HP and then reconnect for the Mac to find it. Turning off the wireless Epson doesn't resolve anything. All software/drivers have been updated.
My HP (USB connected) and Epson (wireless) printers keep losing their connection with my Mac mini. I have to physically disconnect the HP and then reconnect for the Mac to find it. Turning off the wireless Epson doesn't resolve anything. All software/drivers have been updated.
-
Flex with JMS Topic/Queue for Asynchronous messaging
I have been working on Flex and JMS integration using Data
Services for Asynchronous messaging. I am able to do this
successfuly. Now I am in need to do the same without using the Data
Services piece.
For doing this I have done the following ......
I have created a JMS Webservice in the Oracle JDeveloper 10G
along with Webservice Client.I am able to Listen to JMS Topic/Queue
( this has been created in the Oracle AS ) using this Webservice
and receive the messages from this JMS Topic/Queue
Asynchronously.....
But If I need to use the Flex Client , I am not able to
Communicate with this Webservice to listen to the JMS Topic/Queue.
Did any one in this forum tried to communicate with JMS
Topic/Queue without using Flex Data Service.If so please share your
inputs.Here is my confusion (I'm using J2EESDK1.3).
On a local server I did the following
j2eeadmin -addJmsFactory jms/RemoteTCF topic -props url=corbaname:iiop:mars#mars
In the app client running on the local server I had the code
ic = new InitialContext();
// JNDI lookup. The resource factory ref points to the
// Remote Connection Factory I registered
tcf = (TopicConnectionFactory)ic.lookup("java:comp/env/jms/TopicConnectionFactory");
// The env ref points to jms/Topic of the local server
pTopic = (Topic)ic.lookup("java:comp/env/jms/PTopic");
So I'm assuming that I'm using a connection factory that connect to mars and a Topic on the local box.
On remote server mars, I deployed a MDB which use
jms/TopicConnectionFactory and jms/Topic. But I'm thinking this jms/Topic and the one I used on the local box are not the same one. Right? Then how could the app client and the MDB share messages?
Some of my explanation I don't if it makes sense or not.
ConnectionFactory is a way to tell what kind of connection it could generate (Queue, Topic, Durable etc) and Where the connection would go to (local or remote).'
As for as destination, I'm not sure. How could two server share one Topic? -
Sender AS2 adapter settings for Asynchronous MDN
Hello,
I need to configure the settings for AS2 sender adapter for Asynchronous MDN.
In order to configure the asynchrounous MDN Settings which parametrs i need to fill in the channel from below
1) Use Proxy
2) Proxy Server
3) Proxy Port
4) Proxy User
5) Proxy Password
6) Proxy Realm
7) Proxy Protocol
8) Server Certificate (Keystore)
9) Private Key for Client Authentication
Thanks
SrinivasHi,
The MDN asynchronous mode is for the AS2 receiver adapter and not sender.
If you want to use a proxy server, then only you would need to provide the details that you have mentioned and if you are using encryption, you would need to provide the encryption certificate in the corresponding receiver agreement where the comm channel is used.
Also, for asynchronous MDN, you would need to configure a report channel (AS2 sender adapter with message protocol reports) and sender agreement. You need this even if Refer to XI system option is disabled in the AS2 receiver adapter.
Regards -
Adaptive Webservice model for asynchronous web services
Hi ,
While tring to use adaptive Webservice model, using WSDL provided by XI, i was geting the error, <i>Cannot load NameSpaces and ModelClasses</i> . Details of the error can be found in
Error while creating Adaptive WS model(SP17) using local WSDL file
Later when the WSDL was created having other req & resp params, the model got created successfully. Now my question is :
<b>Can't an adaptive Webservice model be created for asynchronous webservices??. Should the Webservice always be synchronous in nature for creating adaptive webservice model??? </b>
Regards,
RajEven I faced the same problem , while running the project it was failing , the error was
=================================================
The initial exception that caused the request to fail, was:
java.io.IOException: Cannot connect to http://www.dataaccess.nl/wk2006/footballpoolwebservice.wso?wsdl: www.dataaccess.nl
at com.sap.engine.services.webservices.tools.WSDLDownloadResolver.resolveEntity(WSDLDownloadResolver.java:161)
at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadDOMDocument(WSDLDOMLoader.java:1019)
at com.sap.engine.services.webservices.wsdl.WSDLDOMLoader.loadWSDLDocument(WSDLDOMLoader.java:1126)
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:178)
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:147)
... 43 more
==============================================
but after setting the proxy details in the visual administrator it started working , this threads details was helpful for me to solve my problem.
thanks ,
Madhusudhan -
Maximum Wait for WS Consumer: SOAMANAGER Logical port
Hello Everyone,
I was trying to configure consumer proxy through SOAMANAGER transaction. When you create a Logical port, within Transport setting you can see a Parameter called 'Maximum Wait for WS Consumer' which as per my understanding is the time for which the consumer is required to wait for a response from Provider.
The problem here is i cannot edit that value. The field is disabled with its default value as '0'(wait for infinite amount of time). I want to make that wait period as just 10 secs.
Am i heading in the right direction? If yes, then how can i edit that value?
Regards
ShaileshHello Shailesh
You should be able to modify this parameter. See the link:
Configuring a Consumer Proxy
http://help.sap.com/saphelp_nwpi71/helpdata/EN/9e/c7a3591dc74a679bbc9716354e42af/content.htm
Are you able to modify any of the other parameters? Does your user have the required authorizations?
Regards
Mark -
How can i find JKM for "Asynchronous Autolog"
How can i find JKM for "Asynchronous Autolog" change data capture?
I do not think there is any. Asynchronous HotLog is supported.
Best,
-FX -
Creating reservation in mb21 for operation consumables&issuing from store
in creating reservation for operation consumables in mb21
in puts are movement type,plant, costcenter ,material, quanity, storage location
i want to see the where documents created
i want see the above fields report
like documents of goods movement in coois report
raviHi,
MBVR Management Program: Reservations
MB22 Change Reservation
MB23 Display Reservation
MB24 Reservation List
MB25 Reservation List
MB51 Material Document List
Hope this will help u.
Regards,
Ashish -
Using alsb for asynchronous messaging
hello @ all,
I like to implement a kind of asynchronous messaging.
It is only possible with the Routing mechanism (see http://e-docs.bea.com/alsb/docs21/consolehelp/proxyactions.html).
But the Client can not perform other works while the server prepares it response.
The question is: How can I use asynchronous messaging, when a client send a request and can continue performing other work while the server prepares it response and the server can notify the client when the response is ready?
The white paper from BEA (http://dev2dev.bea.com/2006/04/AL_Service_Bus_wp.pdf) and other documentation from BEA promise this kind of messaging style.
I use only http for transform Messages. Accordingly I like to accomplish SOAP communications over http for asynchronous requirements.
Can anybody help me to accomplish any scenario with the Aqualogic Service Bus in an asynchronously way?
thanks a lot
FabioAsynchronous messaging using HTTP is possible.
Please follow the below link for documentation
http://e-docs.bea.com/wls/docs91/webserv/advanced.html -
How to use multithreading for asynchronous operation
hi! i am really new to java, i want to improve the performance of my code, some suggested to implement asynchronous operation using multithreading. Please help me how to use multithreading for asynchronous operation. thanks in advance.
http://java.sun.com/docs/books/tutorial/essential/threads/
Note, however, that just making something multithreaded won't necessarily improve performance. You either need multiple CPUs or there needs to be some I/O going on that blocks while something else could be done--other I/O or computing. -
CompletionService for asynchronous recurring tasks
Hi everybody,
I have the following use case: I want to poll and convert newsfeeds.
Which means that my job consists of two different tasks:
1. The polling
Basically this means, that I need to download an xml document. This should be done in a scheduled way like "Download this feed
every n hours". So it is an asynchronous recurring task, that is parametrized with the polling interval specific to each thread.
2 The conversion
Here the newsfeed downloaded before should be converted into a new format.
My idea was not, to achieve this via a ExecutorCompletionService. That would work well, if it weren't for the scheduling and recurrent execution:
You can initialize an ExecutorCompletionService with a ScheduledThreadPoolExecutor as its Executor. But since the ExecutorCompletionService only uses the Executor interface to do its job, I cannot achieve the individual scheduling/recurrent execution
of my download-task like that.
I am currently considering to extend ExecutorCompletionService and override the submit method to handle the scheduling, according to the feed specific interval. Problem here: I do not know how the queuing is implemented in ExecutorCompletionService and how to deal with that.
Please shed some light into this (admittedly very specific) problem :-)
Edited by: er4z0r on 20.01.2010 17:50O.K. I tried to implement a CompletionService for scheduled recurring tasks. And as a word of warning: I did NOT succeed. Don't try this at home ;-)
I did this by extending the CompletionService interface so that it provides scheduling-methods:
package org.example.demo.scheduledcompletion;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
* Extends the CompletionService to allow the usage of scheduled tasks
* @author tbender
public interface ScheduledCompletionService<V> extends CompletionService<V> {
ScheduledFuture<?> submitAtFixedRate(Callable<V> command, long initialDelay, long period, TimeUnit unit);
ScheduledFuture<?> submitWithFixedDelay(Callable<V> command,long initialDelay, long delay, TimeUnit unit);
}I then added a class implementing this interface and internally using a ScheduledExectuorService instead of an normal Executor like ExecutorCompletionService. I took most of the code from ExecutorCompletionService :
package org.example.demo.scheduledcompletion;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
* Immplementation of ScheduledCompletionService using a
* ScheduledExecutorService
* This class is supposed to provide a CompletionService for asynchronous
* recurring tasks. After using one of the schedule methods to schedule a
* recurring task, a Future representing the task will be available once the
* task is done.
* @author tbender
public class ScheduledExecutorCompletionService<V> implements
ScheduledCompletionService<V> {
private final ScheduledExecutorService executor;
private final BlockingQueue<Future<V>> completionQueue;
private final Log log;
* FutureTask extension to enqueue upon completion
* @author tbender
public class QueueingFuture extends FutureTask<V> {
* (non-Javadoc)
* @see java.util.concurrent.FutureTask#run()
@Override
public void run() {
log.debug("run called");
super.run();
log.debug("Size of Completionqueue before adding this task: " + completionQueue.size());
completionQueue.add(this);
log.debug("Size of Completionqueue after adding this task: " + completionQueue.size());
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
log.debug("cancel called");
boolean canceled = super.cancel(mayInterruptIfRunning);
if (canceled) {
log.debug("Successfully canceled.");
} else {
log.warn("No succcess canceling the job");
return canceled;
@Override
public V get() throws InterruptedException, ExecutionException {
log.debug("get called");
return super.get();
@Override
public V get(long timeout, TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException {
log.debug("get called");
return super.get(timeout, unit);
@Override
public boolean isCancelled() {
log.debug("isCancelled called");
return super.isCancelled();
@Override
public boolean isDone() {
log.debug("isDone called");
return super.isDone();
@Override
protected boolean runAndReset() {
log.debug("runAndReset called");
return super.runAndReset();
@Override
protected void set(V v) {
log.debug("set called");
super.set(v);
@Override
protected void setException(Throwable t) {
log.debug("set exception called");
super.setException(t);
public QueueingFuture(Callable<V> callable) {
super(callable);
log.debug("creating QueueingFuture for callable: " + callable);
public QueueingFuture(Runnable t, V result) {
super(t, result);
log.debug("creating QueueingFuture for runnable: " + t
+ " and result " + result);
@Override
protected void done() {
log.debug("done called");
* @param executor
public ScheduledExecutorCompletionService(ScheduledExecutorService executor) {
super();
if (executor == null) {
throw new IllegalArgumentException("You must specify an executor");
this.log = LogFactory.getLog(this.getClass());
this.executor = executor;
this.completionQueue = new LinkedBlockingQueue<Future<V>>();
* @param executor
* @param completionQueue
public ScheduledExecutorCompletionService(
ScheduledExecutorService executor,
BlockingQueue<Future<V>> completionQueue) {
super();
if (executor == null || completionQueue == null) {
throw new IllegalArgumentException();
this.log = LogFactory.getLog(this.getClass());
this.executor = executor;
this.completionQueue = completionQueue;
@Override
public ScheduledFuture<?> submitAtFixedRate(Callable<V> command,
long initialDelay, long period, TimeUnit unit) {
if (command == null) {
throw new IllegalArgumentException();
log.debug("Submitting new " + command.getClass().getName()
+ " at fixed rate of " + period + " " + unit);
QueueingFuture f = new QueueingFuture(command);
return this.executor.scheduleAtFixedRate(f, initialDelay, period, unit);
@Override
public ScheduledFuture<?> submitWithFixedDelay(Callable<V> command,
long initialDelay, long delay, TimeUnit unit) {
if (command == null) {
throw new IllegalArgumentException();
log.debug("Submitting new " + command.getClass().getName()
+ " at fixed delay of " + delay + " " + unit);
QueueingFuture f = new QueueingFuture(command);
return this.executor.scheduleWithFixedDelay(f, initialDelay, delay,
unit);
@Override
public Future<V> poll() {
return this.completionQueue.poll();
@Override
public Future<V> poll(long timeout, TimeUnit unit)
throws InterruptedException {
return this.completionQueue.poll(timeout, unit);
@Override
public Future<V> submit(Callable<V> task) {
if (task == null) {
throw new IllegalArgumentException();
log.debug("Submitting new " + task.getClass().getName());
QueueingFuture f = new QueueingFuture(task);
this.executor.submit(f);
return f;
@Override
public Future<V> submit(Runnable task, V result) {
if (task == null) {
throw new IllegalArgumentException();
log.debug("Submitting new " + task.getClass().getName());
QueueingFuture f = new QueueingFuture(task, result);
this.executor.submit(f);
return f;
@Override
public Future<V> take() throws InterruptedException {
return this.completionQueue.take();
}See next post for tests. -
I am asking for feedback on this design. Here is an example user story:
As a group admin on the website I want to be notified when a user in my group uploads a file to the group.
Easiest solution would be that in the code handling the upload, we just directly create an email message in there and send it. However, this seems like it isn't really the appropriate level of separation of concerns, so instead we are thinking to have a separate
worker process which does nothing but send notifications. So, the website in the upload code handles receiving the file, extracting some metadata from it (like filename) and writing this to the database. As soon as it is done handling the file upload it then
does two things: Writes the details of the notification to be sent (such as subject, filename, etc...) to a dedicated "notification" table and also creates a message in a queue which the notification sending worker process monitors. The entire sequence
is shown in the diagram below.
My questions are: Do you see any drawbacks in this design? Is there a better design? The team wants to use Azure Worker Roles, Queues and Table storage. Is it the right call to use these components or is this design unnecessarily complex? Quality attribute
requirements are that it is easy to code, easy to maintain, easy to debug at runtime, auditable (history is available of when notifications were sent, etc...), monitor-able. Any other quality attributes you think we should be designing for?
More info:
We are creating a cloud application (in Azure) in which there are at least 2 components. The first is the "source" component (for example a UI / website) in which some action happens or some condition is met that triggers a second component or "worker"
to perform some job. These jobs have details or metadata associated with them which we plan to store in Azure Table Storage. Here is the pattern we are considering:
Steps:
Condition for job met.
Source writes job details to table.
Source puts job in queue.
Asynchronously:
Worker accepts job from queue.
Worker Records DateTimeStarted in table.
Queue marks job marked as "in progress".
Worker performs job.
Worker updates table with details (including DateTimeCompleted).
Worker reports completion to queue.
Job deleted from queue.
Please comment and let me know if I have this right, or if there is some better pattern. For example sake, consider the work to be "sending a notification" such as an email whose template fields are filled from the "details" mentioned in
the pattern.Hi,
Thanks for your posting.
This development mode can exclude some errors, such as the file upload complete at the same time... from my experience, this is a good choice to achieve the goal.
Best Regards,
Jambor
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Need help with vomit spill (yes, really!!)
Sad, but true. My son had his iBook on his bed with him when he vomitted. He said he didn't think he had gotten any inside, but it wouldn't turn on. I brought it to the Apple Store and they sent it out for repair. The tech person called me and said t
-
How do I remove an unwanted toolbar? I added a radio station to my ibook and it set up its own toolbar so when I go to Safari I have to use it. It involves using Bing for everything as well. It's very annoying and I want to remove it. I can't jus
-
My operating system is OS X (version 10.6.8) and I have a Mac Mini.
-
Major Problem updating to Photoshop 2014 from Photoshop CC and Opening Lightroom
windows 7 64 bit Updated from Photoshop CC and Lightroom 5 to Photoshop 2014 and Lightroom 5.5. Now Cannot install and run Extension manager and extentions in Photoshop 2014 but continue to work in Photoshop CC. Lightroom 5.5 refuses to open but Li
-
Calulations using TMVL SAP BPC10 NW
Hi Experts I am not sure if this is possible? I am trying to use script logic to forecast some balance sheet account. 1. Get prior years balance for account code AC_2016100 2. Perform a calculation using the prior years balance (cacluation AC_201