You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Mikael Andersson Wigander (Jira)" <ji...@apache.org> on 2021/11/09 13:05:00 UTC

[jira] [Commented] (CAMEL-17181) XPathBuilder never clears pool

    [ https://issues.apache.org/jira/browse/CAMEL-17181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17441152#comment-17441152 ] 

Mikael Andersson Wigander commented on CAMEL-17181:
---------------------------------------------------

Adding a snippet with a file to use

[^FULINS_I_20211106_01of01.zip]

Route:
{code:java}
    from(file("<some-dir>"))
                .streamCaching()
                .unmarshal()
                .zipFile()
                .split()
                .tokenizeXML("RefData")
                .streaming()
                .parallelProcessing(true)
                .bean(XmlToSqlBean.class)
                .end();

{code}
Bean:
{code:java}
  public  class XmlToSqlBean {
        public String toSql(@XPath("//FinInstrmGnlAttrbts/Id") final String isin,
                            @XPath("//NtnlCcy") final String currency,
                            @XPath("//FullNm") final String fullName,
                            @XPath("//TradgVnRltdAttrbts/Id") final String venue,
                            @XPath("//ClssfctnTp") final String classification,
                            @XPath("//TradgVnRltdAttrbts/TermntnDt") final String terminationDate,
                            @XPath("//Issr") final String issuer,
                            @XPath("//MtrtyDt") String maturityDate,
                            @XPath("//TermntdRcrd") final String termnRecord,
                            @XPath("//NewRcrd") final String newRecord) {

            return null;
        }
    }

{code}

> XPathBuilder never clears pool
> ------------------------------
>
>                 Key: CAMEL-17181
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17181
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 3.11.3, 3.12.0
>            Reporter: Mikael Andersson Wigander
>            Priority: Major
>         Attachments: FULINS_I_20211106_01of01.zip
>
>
> When using *@XPath()* annotations to bean method parameters, *XPathBuilder* is used and expressions are added to a pool in the *init()* method of the class.
> These expressions are keep adding up but they are never cleared.
> There's a method *doStop()* which has the code for cleaning but it is never used, hence a leakage of XPathExpressions.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)