Re: ETL compoment

2007-07-28 Thread James Strachan
On 7/26/07, James Strachan <[EMAIL PROTECTED]> wrote:
> On 7/26/07, cui.hailin <[EMAIL PROTECTED]> wrote:
> >
> > in servicemix ,why not development ETL compoment?
> >
> > the requirement of Data Migration is large.
>
> Agreed!
>
> We just had this discussion on the Camel project (Camel BTW works
> great as an EIP router for ServiceMix and JBI)...
>
> http://www.nabble.com/Use-case-question%3A-Can-Camel-be-used-for-dynamic-ETL-tool--tf4135958s22882.html
>
> I'm just in the process of creating a little ETL example in Camel.
> Once thats done, its trivial to deploy it into ServiceMix using the
> camel-jbi-service-unit.  I'll report back in a day or so when I've
> something to look at...

Here's an ETL example in Camel; its fairly simple but hopefully you
get the idea...
http://cwiki.apache.org/CAMEL/etl-example.html
-- 
James
---
http://macstrac.blogspot.com/


relation of camel and servicemix?

2007-07-28 Thread cui.hailin

i recently study camel .
i read the message at http://activemq.apache.org/camel/:Apache Camel can be
used as a routing and mediation engine for the following projects,include
servicemix.

relation of NMR and camel?
-- 
View this message in context: 
http://www.nabble.com/relation-of-camel-and-servicemix--tf4162462s12049.html#a11843432
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.



[jira] Created: (SM-1012) Possible resource leak in FilePoller

2007-07-28 Thread Artur Karazniewicz (JIRA)
Possible resource leak in FilePoller


 Key: SM-1012
 URL: https://issues.apache.org/activemq/browse/SM-1012
 Project: ServiceMix
  Issue Type: Bug
  Components: servicemix-file
Affects Versions: 3.1.1
 Environment: Windows XP, JDK 5.0
Reporter: Artur Karazniewicz
Priority: Minor


In the org.apache.servicemix.components.file.FilePoller#processFile(File) it is 
possible that allocated file would leak. Now, it goes like:

  protected void processFile(File aFile) throws Exception {
String name = aFile.getCanonicalPath();
InputStream in = new BufferedInputStream(new FileInputStream(aFile));
InOnly exchange = getExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, name);
getDeliveryChannel().sendSync(exchange);
in.close();
}

But, we should properly clean-up in the case of exception thrown before 
in.close(). Thus, should be:

  protected void processFile(File aFile) throws Exception {
InputStream in = null;
try {
String name = aFile.getCanonicalPath();
in = new BufferedInputStream(new 
FileInputStream(aFile));
InOnly exchange = 
getExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, name);
getDeliveryChannel().sendSync(exchange);
} 
finally {
if (in != null) {
in.close();
}
}
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (SM-1012) Possible resource leak in FilePoller

2007-07-28 Thread Artur Karazniewicz (JIRA)

[ 
https://issues.apache.org/activemq/browse/SM-1012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39781
 ] 

Artur Karazniewicz commented on SM-1012:


Sorry for formating, here better one:

Now is:

{code}
protected void processFile(File aFile) throws Exception {
String name = aFile.getCanonicalPath();
InputStream in = new BufferedInputStream(new FileInputStream(aFile));
InOnly exchange = getExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, name);
getDeliveryChannel().sendSync(exchange);
in.close();
}
 {code}


Should be:

{code}
protected void processFile(File aFile) throws Exception {
InputStream in = null;
try {
String name = aFile.getCanonicalPath();
in = new BufferedInputStream(new 
FileInputStream(aFile));
InOnly exchange = 
getExchangeFactory().createInOnlyExchange();
NormalizedMessage message = exchange.createMessage();
exchange.setInMessage(message);
marshaler.readMessage(exchange, message, in, name);
getDeliveryChannel().sendSync(exchange);
} 
finally {
if (in != null) {
in.close();
}
}
}
{code}

> Possible resource leak in FilePoller
> 
>
> Key: SM-1012
> URL: https://issues.apache.org/activemq/browse/SM-1012
> Project: ServiceMix
>  Issue Type: Bug
>  Components: servicemix-file
>Affects Versions: 3.1.1
> Environment: Windows XP, JDK 5.0
>Reporter: Artur Karazniewicz
>Priority: Minor
>
> In the org.apache.servicemix.components.file.FilePoller#processFile(File) it 
> is possible that allocated file would leak. Now, it goes like:
>   protected void processFile(File aFile) throws Exception {
> String name = aFile.getCanonicalPath();
> InputStream in = new BufferedInputStream(new FileInputStream(aFile));
> InOnly exchange = getExchangeFactory().createInOnlyExchange();
> NormalizedMessage message = exchange.createMessage();
> exchange.setInMessage(message);
> marshaler.readMessage(exchange, message, in, name);
> getDeliveryChannel().sendSync(exchange);
> in.close();
> }
> But, we should properly clean-up in the case of exception thrown before 
> in.close(). Thus, should be:
>   protected void processFile(File aFile) throws Exception {
>   InputStream in = null;
>   try {
>   String name = aFile.getCanonicalPath();
>   in = new BufferedInputStream(new 
> FileInputStream(aFile));
>   InOnly exchange = 
> getExchangeFactory().createInOnlyExchange();
>   NormalizedMessage message = exchange.createMessage();
>   exchange.setInMessage(message);
>   marshaler.readMessage(exchange, message, in, name);
>   getDeliveryChannel().sendSync(exchange);
>   } 
>   finally {
>   if (in != null) {
>   in.close();
>   }
>   }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.