{"action":"created","comment":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/comments/67404858","id":67404858,"diff_hunk":"@@ -47,22 +51,43 @@\n     private TransactionJournalFile<T, K> notCurrentLogFile;\n \n     /**\n+     * Maximum transaction log file size in bytes.\n+     */\n+    private Long maximumFileSizeInBytes;\n+\n+    /**\n+     * Minimum transaction log file size in bytes to consider it ready for clear content.\n+     */\n+    private Long clearFileMinimumSizeInBytes;\n+\n+    /**\n      * @param logFilesDirectory directory used to store the journal files.\n      */\n-    public TransactionJournal(String logFilesDirectory, TransactionCompletePredicate transactionCompletePredicate, JournalEntrySerializer journalEntrySerializer)\n+    public TransactionJournal(String logFilesDirectory, TransactionCompletePredicate transactionCompletePredicate, JournalEntrySerializer journalEntrySerializer, Integer maximumFileSizeInMegabytes)\n     {\n         File logFileDirectory = new File(logFilesDirectory);\n         if (!logFileDirectory.exists())\n         {\n             Preconditions.checkState(logFileDirectory.mkdirs(), \"Could not create directory for queue transaction logger \" + logFileDirectory);\n         }\n-        File logFile1 = new File(logFileDirectory, \"tx1.log\");\n-        File logFile2 = new File(logFileDirectory, \"tx2.log\");\n+        calculateJournalFileSize(maximumFileSizeInMegabytes);\n+        File logFile1 = new File(logFileDirectory, TX1_LOG_FILE_NAME);\n+        File logFile2 = new File(logFileDirectory, TX2_LOG_FILE_NAME);\n         logger.info(String.format(\"Using files for tx logs %s and %s\", logFile1.getAbsolutePath(), logFile2.getAbsolutePath()));\n \n-        this.currentLogFile = new TransactionJournalFile(logFile1, journalEntrySerializer);\n-        this.notCurrentLogFile = new TransactionJournalFile(logFile2, journalEntrySerializer);\n+        this.currentLogFile = new TransactionJournalFile(logFile1, journalEntrySerializer, clearFileMinimumSizeInBytes);\n+        this.notCurrentLogFile = new TransactionJournalFile(logFile2, journalEntrySerializer, clearFileMinimumSizeInBytes);\n         this.transactionCompletePredicate = transactionCompletePredicate;\n+\n+    }\n+\n+    private void calculateJournalFileSize(Integer maximumFileSizeInMegabytes)\n+    {\n+        if (maximumFileSizeInMegabytes != null)\n+        {\n+            this.maximumFileSizeInBytes = ((long)maximumFileSizeInMegabytes*1024*1024)/2;","path":"core/src/main/java/org/mule/util/journal/TransactionJournal.java","position":54,"original_position":54,"commit_id":"854f8e975c1e8c36bd08eb622ae6d8f3f15c18bb","original_commit_id":"854f8e975c1e8c36bd08eb622ae6d8f3f15c18bb","user":{"login":"dfeist","id":380765,"avatar_url":"https://avatars.githubusercontent.com/u/380765?v=3","gravatar_id":"","url":"https://api.github.com/users/dfeist","html_url":"https://github.com/dfeist","followers_url":"https://api.github.com/users/dfeist/followers","following_url":"https://api.github.com/users/dfeist/following{/other_user}","gists_url":"https://api.github.com/users/dfeist/gists{/gist_id}","starred_url":"https://api.github.com/users/dfeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfeist/subscriptions","organizations_url":"https://api.github.com/users/dfeist/orgs","repos_url":"https://api.github.com/users/dfeist/repos","events_url":"https://api.github.com/users/dfeist/events{/privacy}","received_events_url":"https://api.github.com/users/dfeist/received_events","type":"User","site_admin":false},"body":"formatting + use constant.","created_at":"2016-06-16T19:01:20Z","updated_at":"2016-06-16T19:01:20Z","html_url":"https://github.com/mulesoft/mule/pull/2807#discussion_r67404858","pull_request_url":"https://api.github.com/repos/mulesoft/mule/pulls/2807","_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments/67404858"},"html":{"href":"https://github.com/mulesoft/mule/pull/2807#discussion_r67404858"},"pull_request":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2807"}}},"pull_request":{"url":"https://api.github.com/repos/mulesoft/mule/pulls/2807","id":74132553,"html_url":"https://github.com/mulesoft/mule/pull/2807","diff_url":"https://github.com/mulesoft/mule/pull/2807.diff","patch_url":"https://github.com/mulesoft/mule/pull/2807.patch","issue_url":"https://api.github.com/repos/mulesoft/mule/issues/2807","number":2807,"state":"open","locked":false,"title":"MULE-9931 - Allow to configure the size of the transaction log","user":{"login":"pablolagreca","id":864586,"avatar_url":"https://avatars.githubusercontent.com/u/864586?v=3","gravatar_id":"","url":"https://api.github.com/users/pablolagreca","html_url":"https://github.com/pablolagreca","followers_url":"https://api.github.com/users/pablolagreca/followers","following_url":"https://api.github.com/users/pablolagreca/following{/other_user}","gists_url":"https://api.github.com/users/pablolagreca/gists{/gist_id}","starred_url":"https://api.github.com/users/pablolagreca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablolagreca/subscriptions","organizations_url":"https://api.github.com/users/pablolagreca/orgs","repos_url":"https://api.github.com/users/pablolagreca/repos","events_url":"https://api.github.com/users/pablolagreca/events{/privacy}","received_events_url":"https://api.github.com/users/pablolagreca/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-16T18:51:25Z","updated_at":"2016-06-16T19:01:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6e96854d281ee8e8fc2dd0707b684b3aa833ab48","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mulesoft/mule/pulls/2807/commits","review_comments_url":"https://api.github.com/repos/mulesoft/mule/pulls/2807/comments","review_comment_url":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mulesoft/mule/issues/2807/comments","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/854f8e975c1e8c36bd08eb622ae6d8f3f15c18bb","head":{"label":"mulesoft:MULE-9931","ref":"MULE-9931","sha":"854f8e975c1e8c36bd08eb622ae6d8f3f15c18bb","user":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"repo":{"id":7058562,"name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mulesoft/mule","description":"Mule Community Edition","fork":false,"url":"https://api.github.com/repos/mulesoft/mule","forks_url":"https://api.github.com/repos/mulesoft/mule/forks","keys_url":"https://api.github.com/repos/mulesoft/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulesoft/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulesoft/mule/teams","hooks_url":"https://api.github.com/repos/mulesoft/mule/hooks","issue_events_url":"https://api.github.com/repos/mulesoft/mule/issues/events{/number}","events_url":"https://api.github.com/repos/mulesoft/mule/events","assignees_url":"https://api.github.com/repos/mulesoft/mule/assignees{/user}","branches_url":"https://api.github.com/repos/mulesoft/mule/branches{/branch}","tags_url":"https://api.github.com/repos/mulesoft/mule/tags","blobs_url":"https://api.github.com/repos/mulesoft/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulesoft/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulesoft/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulesoft/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/mulesoft/mule/languages","stargazers_url":"https://api.github.com/repos/mulesoft/mule/stargazers","contributors_url":"https://api.github.com/repos/mulesoft/mule/contributors","subscribers_url":"https://api.github.com/repos/mulesoft/mule/subscribers","subscription_url":"https://api.github.com/repos/mulesoft/mule/subscription","commits_url":"https://api.github.com/repos/mulesoft/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulesoft/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulesoft/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulesoft/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulesoft/mule/contents/{+path}","compare_url":"https://api.github.com/repos/mulesoft/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulesoft/mule/merges","archive_url":"https://api.github.com/repos/mulesoft/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulesoft/mule/downloads","issues_url":"https://api.github.com/repos/mulesoft/mule/issues{/number}","pulls_url":"https://api.github.com/repos/mulesoft/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/mulesoft/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/mulesoft/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulesoft/mule/labels{/name}","releases_url":"https://api.github.com/repos/mulesoft/mule/releases{/id}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2016-06-15T23:41:58Z","pushed_at":"2016-06-16T18:51:25Z","git_url":"git://github.com/mulesoft/mule.git","ssh_url":"git@github.com:mulesoft/mule.git","clone_url":"https://github.com/mulesoft/mule.git","svn_url":"https://github.com/mulesoft/mule","homepage":null,"size":239234,"stargazers_count":339,"watchers_count":339,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":353,"mirror_url":null,"open_issues_count":23,"forks":353,"open_issues":23,"watchers":339,"default_branch":"mule-4.x"}},"base":{"label":"mulesoft:mule-3.x","ref":"mule-3.x","sha":"7d2a3b10b5545c72f9209c76e6ec9f469171d920","user":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"repo":{"id":7058562,"name":"mule","full_name":"mulesoft/mule","owner":{"login":"mulesoft","id":185740,"avatar_url":"https://avatars.githubusercontent.com/u/185740?v=3","gravatar_id":"","url":"https://api.github.com/users/mulesoft","html_url":"https://github.com/mulesoft","followers_url":"https://api.github.com/users/mulesoft/followers","following_url":"https://api.github.com/users/mulesoft/following{/other_user}","gists_url":"https://api.github.com/users/mulesoft/gists{/gist_id}","starred_url":"https://api.github.com/users/mulesoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mulesoft/subscriptions","organizations_url":"https://api.github.com/users/mulesoft/orgs","repos_url":"https://api.github.com/users/mulesoft/repos","events_url":"https://api.github.com/users/mulesoft/events{/privacy}","received_events_url":"https://api.github.com/users/mulesoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mulesoft/mule","description":"Mule Community Edition","fork":false,"url":"https://api.github.com/repos/mulesoft/mule","forks_url":"https://api.github.com/repos/mulesoft/mule/forks","keys_url":"https://api.github.com/repos/mulesoft/mule/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mulesoft/mule/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mulesoft/mule/teams","hooks_url":"https://api.github.com/repos/mulesoft/mule/hooks","issue_events_url":"https://api.github.com/repos/mulesoft/mule/issues/events{/number}","events_url":"https://api.github.com/repos/mulesoft/mule/events","assignees_url":"https://api.github.com/repos/mulesoft/mule/assignees{/user}","branches_url":"https://api.github.com/repos/mulesoft/mule/branches{/branch}","tags_url":"https://api.github.com/repos/mulesoft/mule/tags","blobs_url":"https://api.github.com/repos/mulesoft/mule/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mulesoft/mule/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mulesoft/mule/git/refs{/sha}","trees_url":"https://api.github.com/repos/mulesoft/mule/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mulesoft/mule/statuses/{sha}","languages_url":"https://api.github.com/repos/mulesoft/mule/languages","stargazers_url":"https://api.github.com/repos/mulesoft/mule/stargazers","contributors_url":"https://api.github.com/repos/mulesoft/mule/contributors","subscribers_url":"https://api.github.com/repos/mulesoft/mule/subscribers","subscription_url":"https://api.github.com/repos/mulesoft/mule/subscription","commits_url":"https://api.github.com/repos/mulesoft/mule/commits{/sha}","git_commits_url":"https://api.github.com/repos/mulesoft/mule/git/commits{/sha}","comments_url":"https://api.github.com/repos/mulesoft/mule/comments{/number}","issue_comment_url":"https://api.github.com/repos/mulesoft/mule/issues/comments{/number}","contents_url":"https://api.github.com/repos/mulesoft/mule/contents/{+path}","compare_url":"https://api.github.com/repos/mulesoft/mule/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mulesoft/mule/merges","archive_url":"https://api.github.com/repos/mulesoft/mule/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mulesoft/mule/downloads","issues_url":"https://api.github.com/repos/mulesoft/mule/issues{/number}","pulls_url":"https://api.github.com/repos/mulesoft/mule/pulls{/number}","milestones_url":"https://api.github.com/repos/mulesoft/mule/milestones{/number}","notifications_url":"https://api.github.com/repos/mulesoft/mule/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mulesoft/mule/labels{/name}","releases_url":"https://api.github.com/repos/mulesoft/mule/releases{/id}","deployments_url":"https://api.github.com/repos/mulesoft/mule/deployments","created_at":"2012-12-07T19:23:06Z","updated_at":"2016-06-15T23:41:58Z","pushed_at":"2016-06-16T18:51:25Z","git_url":"git://github.com/mulesoft/mule.git","ssh_url":"git@github.com:mulesoft/mule.git","clone_url":"https://github.com/mulesoft/mule.git","svn_url":"https://github.com/mulesoft/mule","homepage":null,"size":239234,"stargazers_count":339,"watchers_count":339,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":353,"mirror_url":null,"open_issues_count":23,"forks":353,"open_issues":23,"watchers":339,"default_branch":"mule-4.x"}},"_links":{"self":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2807"},"html":{"href":"https://github.com/mulesoft/mule/pull/2807"},"issue":{"href":"https://api.github.com/repos/mulesoft/mule/issues/2807"},"comments":{"href":"https://api.github.com/repos/mulesoft/mule/issues/2807/comments"},"review_comments":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2807/comments"},"review_comment":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mulesoft/mule/pulls/2807/commits"},"statuses":{"href":"https://api.github.com/repos/mulesoft/mule/statuses/854f8e975c1e8c36bd08eb622ae6d8f3f15c18bb"}}}}
{"actor":{"display_login":"dfeist"}}