Retrieve messages with maximum priority
Hi All,
I need to retrieve messages from a queue with maximum priority. Hope i cannot set a MessageSelector query like this 'MAX(JMSPriority)'. Hence, i am creating two message consumers say consumerWithExpeditedPriority with MessageSelector string as 'JMSPriority > 4' and consumerWithNormalPriority with MessageSelector string as 'JMSPriority <= 4'.
First i am attempting to receive through the first consumer and if the message is null, i am trying out the second.
Is this the good way of implementation? Moreover, here i could classify only 2 levels of priority (normal and expedited) since i created two consumers. Actually, i needed all the 10 levels of JMSPriority to be handled out separately.
Please provide your valuable suggestions
Thanks and Regards,
Balaji N
Hi MA ...
Is this account your main e-mail account or a alias ??
Did you change your NEW e-mail account also by your e-mail provider (server) You have to delete the old e-mail address from that server to.
Dimaxum
Similar Messages
-
Polling messages based on priority in BPEL using JMS adapter
Hi All,
Is it possible to poll the messages based on the priority in BPEL using JMS adapter?
I could set the priority for the messages but while polling it is picking the messages in FIFO(First in First out) order. But I want the messages to be picked on priority.Any help is appreciated.Do you only want to pick up messeges with a certain priority? So anything larger than say priority 2?
You can try this: Oracle JCA Adapter for JMS - 11g Release 1 (11.1.1.5.0)
Message SelectorThis field is also optional. It filters messages based on header and property information. The message selector rule is a Boolean expression. If the expression is true, then the message is consumed. If the expression is false, then the message is rejected.For example, you can enter logic, such as:
JMSPriority > 3. Based on this, messages with a priority greater than 3 are consumed; all other messages are rejected.
JMSType = 'car' AND color = 'blue' AND weight > 2500
Country in ('UK', 'US', 'France') -
Can't see msgs in UWC / reconstruct fails with cannot retrieve message uid
I have restored several email accounts into a test email account. I'm trying to move some of the .msg files around so that they are easier to find. I have created some new folders and when I move the messages into the folder, I cannot see them in the web client. If I run reconstruct, I get
ERROR: Inconsistent information: 0 idx records 41 messages 0 expunged
Reconstructing...
cannot retrieve message uid 590
cannot retrieve message uid 807
cannot retrieve message uid 911
cannot retrieve message uid 915
cannot retrieve message uid 1198
cannot retrieve message uid 1286
etc where the number at the end is the name of the .msg file.
# imsimta version
Sun Java(tm) System Messaging Server 6.3-4.01 (built Aug 3 2007; 64bit)
libimta.so 6.3-4.01 (built 17:28:45, Aug 3 2007; 64bit)
SunOS message1 5.10 Generic_127111-02 sun4u sparc SUNW,Sun-Fire-V245
Normally, after restoring email, I have to recreate the mail folders (either via mboxutil or manually via the UWC or a client), then run reconstruct. Even then, often the messages will show as 'deleted' until I either move them to a different folder or go into the UWC and mark them as undeleted. At this point, I can't see the recently restored messages at all in the UWC. They are on the server. Any ideas would be greatly appreciated.In general, manually moving files around inside the store like this should be discouraged.
reconstruct is telling you something is wrong:
ERROR: Inconsistent information: 0 idx records 41 messages 0 expunged
Reconstructing...
cannot retrieve message uid 590
cannot retrieve message uid 807
cannot retrieve message uid 911
cannot retrieve message uid 915
cannot retrieve message uid 1198
cannot retrieve message uid 1286The first line is to be expected based on what you have done. The store.idx indicates there are no messages in the folder. But it found 41 .msg files. So it is going to rebuild store.idx to fix that.
But then there is some problem with accessing the .msg files. Possibilities would include:
- wrong ownership/permissions?
- the .msg file being in the wrong NN subdir ??
If those guesses do not lead to anything, try truss on the reconstruct command to see what happens when reconstruct tries to open those files. -
I have an apple id but when i want regester with icloud on my iphone I get the message "THE MAXIMUM NUMBER OF FREE ACCOUNTS HAVE BEEN ACTIVATED ON THIS IPHONE."
On the web of icloud when i try to sign in with apple ID i get the Message "THIS APPLE ID IS VALID BUT IS NOT AN ICLOUD ACCOUNT"
Hence i cant create Icloud account.
please let me know how i can resolve the above mentioned issue
Thanks.Apple limits iOS devices to three free iCloud accounts, & once that limit is reached on an iOS device you can no longer create a new account on that device. The solution is to create the account on a computer or another iOS device, then set that account up on your present iOS device.
-
I have an odd problem that so far Cisco has not been able to resolve. We are in the process of migrating from AT&T fiber to Comcast Business Fiber. All DNS records have been moved over. We currently have both links up. The ASA configuration is setup for tracking (redundancy). All of our outbound traffic is going through the Comcast link (default route) and most of our incoming traffic via DNS has been setup to the new external IP configured on the secondary up-link for Comcast.
Here is the problem: When I change our MX records from AT&T to Comcast; messages are delayed. Often times 5-10 times longer than using the AT&T link. On several occasions, the messages are delayed so much, that the sender server drops the connection. We have a 15 minute timeout configured on the IronPort (ESA C170). but that is the same configuration used by AT&T.
At first, the thought was a config problem on our ASA (55xx series). However, after hours of support from the ASA team, it was determined not to be a problem with the ASA. Later as a confirmation, I changed the Comcast IP route to bypass the C170 and emails flow as expected (omit spam detection).
The ESA simply listens to port 25 traffic, checks for spam and viruses and then pass that information to Exchange 2010.
Been working with the ESA team for nearly 2 weeks and they cannot seem to find a problem. But again, if I bypass the ESA, there are no issues. The ASA has been configured so that SMTP traffic has priority and confirmed that Port 25 is open.
What I have done currently is leave our production SMTP (MX) records pointing to our AT&T IP, and configured a temporary domain (xxxxxx.COM) to point to our Comcast IP. I configured both Exchange and the Ironport to accept messages from that domain. I have followed message tracking over and over again, tried and review packet captures and provide every possible log to Cisco. What I am seeing is that the message(s) stop at the point where it is retrieving the message header. For example, I have one message that the connection was accepted at 1333hours, it matched SBRS, was accepted via the TLS Protocol. The message connection continues and the last line before the delay is the incoming connection added the recipients email address. After that, there is nearly a 12 minutes delay until the next item which is the message ID header. With my test domain, the message will eventually be received and forwarded on to our exchange server. The later steps taking just seconds.
If I used one of our production domains, messages are dropped. Those same messages, the message tracking does not record a subject line (by way of the message headers).
Can anyone shine a light on why this is occurring? I can provide any logs, captures or message tracking details you may need. I just need to get this resolved.
Recap:
Email sent from say Live.com (Microsoft Hotmail Servers) to our ATT IP through our ASA firewall then through the IronPort; that email arrives on time.
Email sent with an attachment from Live.com (Microsoft Hotmail Servers) to our ATT IP through our ASA firewall then through the IronPort; that email arrives on time.
Email sent from Live.com (Microsoft Hotmail Servers) to our Comcast IP through our ASA firewall then through the IronPort; that email arrives on time.
Email sent with an attachment from Live.com (Microsoft Hotmail Servers) to our Comcast IP through our ASA firewall then through the IronPort; that email is delayed.
Email sent with an attachment from Live.com (Microsoft Hotmail Servers) to our Comcast IP through our ASA firewall bypassing the IronPort; that email arrives on time.
The tests messages with attachments vary from 1MB-3MB. The Max message size is 50MB. Our ATT connection is 15Mbps. Our Comcast connection is 50Mbs. Other than the ESA, there is no other gear between the ASA and our Exchange servers.
Thank you,I did, that is what the guy at apple had me do, and also Its been well over 48 hours, thank you though.. any other suggestions..
and ps the time on the phone was messed up again this morning -
I'm using acrobat pro in my project after debuging the project and after opening a certain number of PDF files I receive the message: the maximum number of files opened has been reached, you have to close some files to continu.even doing that, I steel receive the same message.Some one can tel what to do please? Thanks
Hi Memalyn
Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
Let us know what you find out, and if you manage to get your space back.
Matt -
GMail POP3 problem: Not getting messages with sender "me"
HI guys,
I have an account called [email protected] , I successfully sent mails to the same using javamail.In this messages,sender is marked as "me".
Now I want to read all the messages in inbox,including the messages sent by same account itself.(messages with "me" sender).
But I notices that javamail doesnt read any messages which the sender is "me".
Is there a solution for this?
thanks in advance,
umanga
Edited by: virtualumanga on Jun 6, 2008 7:09 PM
Edited by: virtualumanga on Jun 6, 2008 7:10 PMOk.Heres what happens.
When I send emails to the same account using gmail webbase application , those mails (which the sender is "me") are read from my Java-POP3 code.
But when I send mail using my Java-SMTP code , and try to retrieve them using same Java-POP3 program,those mails are not read.
Here is my temp account that I am using
user : [email protected]
password: umanga123
You can see there are 3 mails (please dont delete them) , which were sent using my Java-SMTP code.And one mail which is,sent from my yahoo account.
Below Is the java-POP3 code that I am reading my messages.You can run them your self and see that the messages with "me" and not reading,only the message from yahoo is reading.
You can test following code without any modifications..
Please help,
thanks in advance.
public class MailGet {
public static void main(String args[]) throws Exception
String host="pop.gmail.com";
String user="fhb.test";
String pwd="umanga123";
//String from="[email protected]";
//String to="umanga@quicksilver";
Properties props=new Properties();
props.put("mail.pop3.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.pop3.socketFactory.fallback", "false");
props.put("mail.pop3.port", "995");
props.put("mail.pop3.socketFactory.port", "995");
//FileInputStream fis=new FileInputStream("/home/umanga/pop.prop");
//props.load(fis);
Session session=Session.getDefaultInstance(props,
null);
try {
Store store=session.getStore("pop3s");
store.connect(host,user,pwd);
Folder folder=store.getDefaultFolder().getFolder("Inbox");
folder.open(Folder.READ_WRITE);
System.out.println("Getting messages");
Message msg[]=folder.getMessages();
System.out.println(folder.getMessageCount()+" "+folder.getUnreadMessageCount());
for(int i=0;i<msg.length;i++)
System.out.println("Subject: "+msg.getSubject() );
folder.close(true);
} catch (Exception e) {e.printStackTrace(); }
Edited by: virtualumanga on Jun 7, 2008 4:45 AM
Edited by: virtualumanga on Jun 7, 2008 4:46 AM
Edited by: virtualumanga on Jun 7, 2008 5:21 AM -
When I try to sign in with my Apple ID (that I use with AppStore) to iCloud on my iPad2,
I see this message:
''The maximum number of free accounts have been activated on this iPad''.
So what shall I do?Welcome to the Apple Community.
Unfortunately once all the 3 iCloud accounts have been created on your mobile device, you cannot create any more regardless of what you do. You will need to re-use one of the accounts that you have already created or create your new account on another device or computer. -
Send attachment with maximum characters
I need to extract data from a table into a .csv and then send that .csv as an attachment.
I am converting the data to csv and assigning it to clob variable but table has huge data therefore procedure gets error out after around 7000 characters with
ORA-06502: PL/SQL: numeric or value error.
Please suggest a way to send attachment with maximum characters.
With the below sample code i am able to send atttachement upto 7000 characters.
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test subject';
v_Mail_Host VARCHAR2(30) := 'mail.mycompany.com';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
v_message clob;
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
utl_smtp.Data(v_Mail_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard
'Content-Type: multipart/mixed;'|| crlf ||
' boundary="-----SECBOUND"'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/plain;'|| crlf ||
'Content-Transfer_Encoding: 7bit'|| crlf ||
crlf ||
'some message text'|| crlf || -- Message body
'more message text'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/plain;'|| crlf ||
' name="excel.csv"'|| crlf ||
'Content-Transfer_Encoding: 8bit'|| crlf ||
'Content-Disposition: attachment;'|| crlf ||
' filename="excel.csv"'|| crlf ||
crlf ||
v_message|| crlf || -- Content of attachment
crlf ||
'-------SECBOUND--' -- End MIME mail
utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;
Thanks,Thanks for your help Billy.
I am able to segment the data but I am not getting any attachment instead segmented data is showing in the mail body.
Can you please have a look and let me where it is going wrong?
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test mail';
v_Mail_Host VARCHAR2(30) := 'localhost';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
v_message clob;
message clob;
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
v_message := 'date: ' || to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS')||chr(10)||
'from: '||v_From|| chr(10) ||
'to: '||v_Recipient ||chr(10)||
'subject: '||v_Subject || chr(10) || chr(10);
utl_smtp.open_data (v_Mail_Conn);
utl_smtp.write_data(v_Mail_Conn , v_message );
--MIME header.
UTL_SMTP.WRITE_DATA(v_Mail_Conn,'MIME-Version: 1.0' || crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Type: multipart/mixed;' || crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn,' boundary="-----SECBOUND"' ||crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn,crlf);
-- Mail Body
UTL_SMTP.WRITE_DATA(v_Mail_Conn,'-------SECBOUND'|| crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Type: text/plain;' || crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Transfer_Encoding: 7bit' || crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn, crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn, 'Please see the attachments' || crlf);
UTL_SMTP.WRITE_DATA(v_Mail_Conn, crlf);
-- Mail Attachment
utl_smtp.write_data(v_Mail_Conn,'-------SECBOUND' || crlf);
utl_smtp.write_data(v_Mail_Conn,'Content-Type: text/plain;' || crlf);
utl_smtp.write_data(v_Mail_Conn,'name="excel.csv"' ||crlf);
utl_smtp.write_data(v_Mail_Conn,'Content-Transfer_Encoding: 8bit' ||crlf);
utl_smtp.write_data(v_Mail_Conn,'Content-Disposition: attachment;' ||crlf);
utl_smtp.write_data(v_Mail_Conn,'filename="excel.csv"' ||crlf);
utl_smtp.write_data(v_Mail_Conn,crlf);
message := 'OBJECT_TYPE, OBJECT_FOREIGNKEY, OPERATION, EVENT_ID, STATUS_ID, NUM_BLOCKED, MODIFIED_DATE, INT_UPDATEEVENT_FMWID, ERROR_DESCRIPTION';
utl_smtp.write_data(v_Mail_Conn , message );
for rec in (
select object_type, object_foreignkey, operation, x.event_id, x.status_id, num_blocked,
e.modified_date, e.INT_UPDATEEVENT_FMWID, replace(substr(e.error_description,1,100),',',' ') error_description
from (
select b2.object_type, b2.object_foreignkey, t.operation, e2.event_id, e2.status_id, count(1) num_blocked
from EVENT e
INNER JOIN TRANSACTION t
ON e.transaction_id = t.transaction_id
inner join transaction_dependency d
on t.transaction_id = d.transaction_id
inner join transaction_block b
on t.transaction_id = b.transaction_id
inner join transaction_block b2
on d.transaction_id <> b2.transaction_id
and d.object_type = b2.object_type
and d.object_foreignkey = b2.object_foreignkey
inner join transaction t2
on b2.transaction_id = t2.transaction_id
and t.source_type = t2.source_type
inner join event e2
on t2.transaction_id = e2.transaction_id
where t.source_type = 'CRM_OD_To_OP'
and e.created_date >=(sysdate - 1)
and e.status_id <1000
and e2.status_id <1000
group by b2.object_type, b2.object_foreignkey, t.operation, e2.event_id, e2.status_id
) x
inner join event e
on x.event_id = e.event_id
and e.status_id = 900
order by num_blocked desc, object_type, object_foreignkey
) loop
message := crlf || rec.object_type||','||rec.object_foreignkey||','|| rec.operation|| ','|| rec.event_id||
','||rec.status_id||','||rec.num_blocked||','||rec.modified_date||','||rec.INT_UPDATEEVENT_FMWID||','||rec.error_description;
utl_smtp.write_data(v_Mail_Conn , message );
end loop;
utl_smtp.write_data(v_Mail_Conn,crlf);
utl_smtp.write_data(v_Mail_Conn,'-------SECBOUND');
utl_smtp.close_data(v_mail_conn);
utl_smtp.quit( v_mail_conn );
EXCEPTION
WHEN others then
dbms_output.put_line('error ' || sqlerrm);
END; -
Monitoring SAPconnect message with error into RZ20
Hello,
I would like to send an alert by e-mail every time a message aimed at being sent outside SAP (through SAPconnect layer) fails.
I have customized using standard help and OSS notes 546493 and 683974.
Into RZ20, I have customized the INT node with the following data:
maximum of alerts kept = 1
the newest alerts are kept
set "value obsolete" after 0 seconds
Performance attributes
last reported value
threshold values : 0 for the 4 fields
alert is triggered if the comparative value exceeds the treshold value
Methods attributes
start the data collection every 300 seconds
data collection method = SAPconnect
auto-reaction method = ZCCMS_Send_Alert_to_ALM_V2 (duplicated from CCMS_Send_Alert_to_ALM_V2)
With this customizing, I expected to trigger an alert at every message with error.
Unfortunately, it triggers the alerts only at the first message in error.
I have to complete the alert manually to expect an alert trigged for the following message with error.
Is there a way to complete the alert automatically (as soon as it is triggered) ?
Or how can I do to achieve what I would like to do ?
Thank you very much for your help.
Regards,
FabriceHello Alexander,
yes, I have tried to set the "value obsolete" to 1 seconde.
Indeed, the value becomes obsolete but the alert is not completed.
Then, for the following error, I get a new value but no new alert is triggered.
Thank you.
Regards,
Fabrice -
Preparing to retrieve messages... forever
Sometimes I check my email connected with my mobilephone or a bad wireless connection. If I get disconnected when Mail is checking for new messages - in the middle of downloading a bigger email... it seems like the Mail app get serious problems. The account that was disconnected cannot check mail anymore, and hangs with the activity "Preparing to retrieve messages" forever. The only way I can get the specific account to work again is to check the pop-account and download the messages with an another email program. When the pop-server is empty it seems like the Mail app resets and it will allow me to check for new mail again.
It's very frustrating!
Please Apple! Is it something to do, other than having using my old Eudora program just to reset the account. And why is it possible to download messages with Eudora?
Someone with the same problem?nothing changed on both ends, not just my computer but also the server. Another kicker is a fellow employee has had the same issue for months before I ever had it. And another colleague doesnt have the issue at all. I tried re-installing mail, deleting all preferences, all accounts and installed the app from disc and that did not work either.
-
TS2755 How can I retrieve messages that I accidentally cleared?
How do I retrieve messages that were accidentally cleared?
If it's on iMessage go to another iMessage device that's currently set up with your account and it might be there. If it's a normal text, go online or contact your provider to see your incomming and outgoing messages.
-
Why I can't send any e-mail messages with 6230i?
Hi mates,
I have a Nokia 6230i with a Vodafone Italian sim card in it.
I know for sure that I CAN retrieve messages form my incoming POP3 e-mail server but I can't send any e-mail messages with it.
Any time I try to do that it prompts me an information balloon saying: message failed. Why??
I mean, I properly set up my phone with all Vodafone details but it still does not seem to work.
Any help will be appreciate
Stefano.
P.S.
I can even send and receive MMS and of course SMS too
Solved!
Go to Solution.thanks mate for your reply
When you say: "Make sure your SP allows sending e-mail"
Do you mean the provider who give me the mail service?
Because I know for sure that with MS Outlook express I can send and recive e-mail with it
Bye,
Stefano. -
Display problems in Mail messages with image attachment
Issue: Seeing intermittent display problems in Mail messages with image attachments
Annoyance level: minor, but Apple techs need to pass it along
Details: Regardless of mail client sending to iPhone (Outlook, OWA, Yahoo, Gmail) there are intermittent and what appear to be random occurrances of the pic being half rendered and/or the pic never loading (followed by message saying it can't be retrieved from server). In some instances the picture then appears fully rendered without a problem. Note: Image sizes varied from 14KB to 450KBHi,
I'm not familiar with C#, but if possible try the following:
1. Removing all thead and tbody tags from the body of the message.
2. Changing all inline CSS to embedded CSS.
I've seen a user said the message stopped showing up after making the changes.
If the issue persists, please note, since Outlook 2007, Outlook opens the HTML Email and converts it to Microsoft Word format before displaying it to the user. What happens during this process is that many CSS attributes and HTML support is completely removed.
Some of the most notable absences are background-image, and padding and margin support. Hardly can we do much about this, so the message "If there are problems with how this email is displayed, click here to view it in a web browser" is actually
a good workaround when we face this problem.
Regards,
Melon Chen
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. -
Retrieving messages from MQ Series
Hi,
We have the situation where we need to receive messages from our partner, who only can use MQ Series to send them. So we are looking into ways how to solve it on our end, which is on a Unix server. We will only read messages, and the other side will be a black box for us which will provide us with settings to connect to their manager.
Do we need to install a client software (which IBM seems to provide for free) and on top of that use a Java API? Or do we use JMS on top of the client?
Or if we use JMS, isn't the client needed?
ThanksHi
I am trying to read messages from the MQ using the following code.
The queue used by this program is shared, msg is pushed other program and this progam fetch the msg and save it physically.
I m facing a problem, say there are 15 messages, then 15 files should be created, some time it creates 15 files one for each message, while some times it creates less then 15 files.
String messageType = null;
String docId = null;
String idocData = null;
String fileName = null;
String msgId = null;
try {
// Create a queue manager object and access the queue
// that will be used for getting the messages.
qMgr = new MQQueueManager(qManager, env);
//int openOptions = MQC.MQOO_INPUT_EXCLUSIVE | MQC.MQOO_BROWSE | MQC.MQOO_INQUIRE;
int openOptions = MQC.MQOO_INPUT_SHARED | MQC.MQOO_BROWSE | MQC.MQOO_INQUIRE | MQC.MQOO_FAIL_IF_QUIESCING;
queue = qMgr.accessQueue(qName, openOptions, null, null, null);
MQGetMessageOptions gmo = new MQGetMessageOptions();
// Get the count of messages present into Queue.
int messageCnt = queue.getCurrentDepth();
_logger.info("Current Depth of MQ is : "+ messageCnt);
if (messageCnt > cnt && cnt != 0) {
messageCnt = cnt;
// If count is greater than Zero then get the message from Queue
// and creates the file under the target folder.
if (messageCnt > 0) {
for (int i = 0; i < messageCnt; i++) {
_logger.info("Depth of MQ Before reading : "+ queue.getCurrentDepth());
messageType = "";
docId = "";
idocData = "";
fileName = "";
msgId = "";
MQMessage message = new MQMessage();
queue.get(message, gmo);
byte[] data = new byte[message.getMessageLength()];
String msg = null;
message.readFully(data);
_logger.info("Getting File : "+ (i+1));
try {
msg = new String(data);
messageType = msg.substring(147, 177).trim();
docId = msg.substring(121, 137).trim();
idocData = msg.substring(108, msg.length());
msgId = String.valueOf(System.currentTimeMillis());
// Getting inbox folder path
if (messageType.trim().equalsIgnoreCase("INVOIC01")) {
targetFolder = BOCConfig.getProperty("invoice.inbox.folder");
} else if (messageType.trim().equalsIgnoreCase("DELVRY03")) {
targetFolder = BOCConfig.getProperty("asn.inbox.folder");
fileName = createFile(idocData, msgId, messageType, targetFolder);
_logger.info("File Created no " + (i+1) +" with msgId " + msgId + " messageType " + messageType + " DocId " +docId);
_logger.info("Depth of MQ After reading : "+ queue.getCurrentDepth());
} catch (NullPointerException ne) {
String strMsg = "Edgeware got junk or null message from MQ which is not proceed by MQ Adapter.";
fileName = createFile(idocData, msgId, messageType, failedFolder);
raiseAlert(strMsg, messageType, docId, fileName, ne.getMessage());
} catch (StringIndexOutOfBoundsException siobe) {
String strMsg = "Edgeware got invalid message from MQ which is not handled by MQ Adapter.";
fileName = createFile(idocData, msgId, messageType, failedFolder);
raiseAlert(strMsg, messageType, docId, fileName, siobe.getMessage());
} catch (Exception e) {
String strMsg = "Edgeware got error while creating idoc file or DB transction";
fileName = createFile(idocData, msgId, messageType, failedFolder);
raiseAlert(strMsg, messageType, docId, fileName, e.getMessage());
// closing the queue.
queue.close();
} catch (MQException ex) {
String strMsg = "Edgeware got MQ Error while connecting/retrieving message from Queue";
String err = "MQ exception: CC = " + ex.completionCode + " RC = " + ex.reasonCode;
raiseAlert(strMsg, messageType, docId, failedFolder, err);
} catch (IOException e) {
String strMsg = "Edgeware got MQ Error while reading message from the Queue";
raiseAlert(strMsg, messageType, docId, failedFolder, e.getMessage());
}catch (Throwable th) {
String strMsg = "Edgeware got Runtime Exception";
raiseAlert(strMsg, messageType, docId, failedFolder, th.getMessage());
}
Maybe you are looking for
-
How to configure AD on windows 2012 server for Exchange 2013 internal and external email flow
Dear Experts, I have to configure exchange 2013 on Windows server 2012 STD. Company has registered Static IP addresses and can get the MX record pointing to any of this Static IP. The registered domain name is e.g. contoso.com. a. What should I u
-
Corrupt image in Safari, but not Firefox or Chrome
I sent an image link from flickr of a photo generated by hugin - a panorama stitcher. The image looks fine in Chrome and Firefox however I was sending the link to my father who only uses Safari. In safari the image shows up initially without contra
-
Document Set issue - Missing documents
after changing meta data on a document set, all documents in the document set disappear. Is there a fix for this?
-
ERROR: RMI Class loader disabled
Despite of setting classpath, policy tool I am getting following error. What does the error mean and What is the solution? E:\Javaprog\RMI>java MultiplyServerImpl Server could not start java.rmi.ServerException: RemoteException occurred in server thr
-
Firefox 1.0 or 2.0 are the only versions certified for my Mac OS 10.4.11 and to use with the learning system on campus here at the University of New Mexico. I have an iMac, Power PC G4, purchased in September of 2003. It has a 1.25 GHz processor and