diff --git a/docs/Makefile b/docs/Makefile index e74f6866f9..d2e589c55e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -16,6 +16,8 @@ endif PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +HTMLSPHINXOPTS = $(ALLSPHINXOPTS) -t htmlmode +PDFSPHINXOPTS = $(ALLSPHINXOPTS) -t pdfmode # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source @@ -52,17 +54,17 @@ clean: rm -rf $(BUILDDIR)/* html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXBUILD) -b html $(HTMLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + $(SPHINXBUILD) -b dirhtml $(HTMLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + $(SPHINXBUILD) -b singlehtml $(HTMLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." @@ -77,7 +79,7 @@ json: @echo "Build finished; now you can process the JSON files." htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + $(SPHINXBUILD) -b htmlhelp $(HTMLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." @@ -114,20 +116,20 @@ epub: @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + $(SPHINXBUILD) -b latex $(PDFSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + $(SPHINXBUILD) -b latex $(PDFSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + $(SPHINXBUILD) -b latex $(PDFSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." @@ -192,4 +194,4 @@ pseudoxml: @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." pdf: - $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf + $(SPHINXBUILD) -b pdf $(PDFSPHINXOPTS) $(BUILDDIR)/pdf diff --git a/docs/make-docsite.sh b/docs/make-docsite.sh index 1030bd766a..5c43e44e61 100755 --- a/docs/make-docsite.sh +++ b/docs/make-docsite.sh @@ -13,11 +13,10 @@ fi # TODO: The PDF rendering is pretty ugly and can be improved a lot. echo "Generating PDF document ..." -make pdf +make latexpdf echo "Generating HTML pages ..." make html -echo "Moving PDF file into place ..." -mv $PWD/build/pdf/corda-developer-site.pdf $PWD/build/html/_static/corda-developer-site.pdf - +echo "Moving PDF file from $(eval echo $PWD/build/pdf/corda-developer-site.pdf) to $(eval echo $PWD/build/html/_static/corda-developer-site.pdf)" +mv $PWD/build/latex/corda-developer-site.pdf $PWD/build/html/_static/corda-developer-site.pdf \ No newline at end of file diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 9bb0fc3798..d564e95efc 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -8,6 +8,8 @@ Unreleased ========== * Introduced a hierarchy of ``DatabaseMigrationException``s, allowing ``NodeStartup`` to gracefully inform users of problems related to database migrations before exiting with a non-zero code. +* Improved documentation PDF quality. Building the documentation now requires ``LaTex`` to be installed on the OS. + * Add ``devModeOptions.allowCompatibilityZone`` to re-enable the use of a compatibility zone and ``devMode`` * Fixed an issue where ``trackBy`` was returning ``ContractStates`` from a transaction that were not being tracked. The @@ -153,12 +155,15 @@ Version 3.1 * Update the fast-classpath-scanner dependent library version from 2.0.21 to 2.12.3 - * Added `database.hibernateDialect` node configuration option + .. note:: Whilst this is not the latest version of this library, that being 2.18.1 at time of writing, versions + later than 2.12.3 (including 2.12.4) exhibit a different issue. + +* Added `database.hibernateDialect` node configuration option .. _changelog_r3_v3: Corda Enterprise 3.0 Developer Preview ------------------------------- +-------------------------------------- * Fix CORDA-1229. Setter-based serialization was broken with generic types when the property was stored as the raw type, List for example. diff --git a/docs/source/conf.py b/docs/source/conf.py index 79c76d5c7a..ba3ed0bd61 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,16 +14,15 @@ import sphinx_rtd_theme - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # m2r is a Markdown to RST converter, as our design docs use Markdown. extensions = ['rst2pdf.pdfbuilder', 'm2r'] @@ -33,6 +32,7 @@ pdf_documents = [('index', u'corda-developer-site', u'Corda Developer Documentat pdf_stylesheets = ['sphinx', 'kerning', 'a4', 'murphy', 'tenpoint'] pdf_compressed = True pdf_fit_mode = "shrink" +pdf_fit_background_mode = "shrink" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -72,28 +72,30 @@ language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] +if tags.has('pdfmode'): + exclude_patterns = ['./design'] # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' @@ -101,15 +103,14 @@ pygments_style = 'sphinx' highlight_language = 'kotlin' # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False +# keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False - # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -125,21 +126,21 @@ html_add_permalinks = True # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -156,103 +157,101 @@ html_style = 'css/custom.css' # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +# html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -#html_search_language = 'en' +# html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} +# html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' +# html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'R3doc' # -- Options for LaTeX output --------------------------------------------- -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', - -# Latex figure (float) alignment -#'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'R3Prototyping.tex', u'R3 Prototyping Documentation', - u'R3 CEV', 'manual'), -] +latex_documents = [('index', u'corda-developer-site.tex', u'Corda Developer Documentation', u'R3', 'manual', False)] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # 'preamble': '', + + # Latex figure (float) alignment + # 'figure_align': 'htbp', + + 'maxlistdepth': 2000, + + 'extraclassoptions': 'openany', +} diff --git a/docs/source/index.rst b/docs/source/index.rst index ab29cf9422..b4d305e7d6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -57,16 +57,18 @@ application development please continue to refer to `the main project documentat loadtesting.rst certificate-revocation -.. toctree:: - :caption: Design docs - :maxdepth: 2 +.. only:: htmlmode - design/design-review-process.md - design/certificate-hierarchies/design.md - design/failure-detection-master-election/design.md - design/float/design.md - design/hadr/design.md - design/kafka-notary/design.md - design/monitoring-management/design.md - design/sgx-integration/design.md + .. toctree:: + :caption: Design docs + :maxdepth: 2 + + design/design-review-process.md + design/certificate-hierarchies/design.md + design/failure-detection-master-election/design.md + design/float/design.md + design/hadr/design.md + design/kafka-notary/design.md + design/monitoring-management/design.md + design/sgx-integration/design.md diff --git a/docs/source/key-concepts-consensus.rst b/docs/source/key-concepts-consensus.rst index d679dc1f45..a1a5b906ef 100644 --- a/docs/source/key-concepts-consensus.rst +++ b/docs/source/key-concepts-consensus.rst @@ -7,12 +7,15 @@ Consensus * *Validity consensus requires contractual validity of the transaction and all its dependencies* * *Uniqueness consensus prevents double-spends* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Two types of consensus ---------------------- diff --git a/docs/source/key-concepts-contracts.rst b/docs/source/key-concepts-contracts.rst index c430ea1123..77e79fcd0f 100644 --- a/docs/source/key-concepts-contracts.rst +++ b/docs/source/key-concepts-contracts.rst @@ -7,12 +7,15 @@ Contracts * *Contracts are written in a JVM programming language (e.g. Java or Kotlin)* * *Contract execution is deterministic and its acceptance of a transaction is based on the transaction's contents alone* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Transaction verification ------------------------ diff --git a/docs/source/key-concepts-flows.rst b/docs/source/key-concepts-flows.rst index 982d646214..b50be364a6 100644 --- a/docs/source/key-concepts-flows.rst +++ b/docs/source/key-concepts-flows.rst @@ -7,12 +7,15 @@ Flows * *Communication between nodes only occurs in the context of these flows, and is point-to-point* * *Built-in flows are provided to automate common tasks* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Motivation ---------- @@ -22,9 +25,19 @@ what order. Here is a visualisation of the process of agreeing a simple ledger update between Alice and Bob: -.. image:: resources/flow.gif - :scale: 25% - :align: center +.. only:: htmlmode + + .. image:: resources/flow.gif + :scale: 25% + :align: center + + +.. only:: pdfmode + + .. image:: resources/flow.png + :scale: 25% + :align: center + The flow framework ------------------ diff --git a/docs/source/key-concepts-ledger.rst b/docs/source/key-concepts-ledger.rst index 8741c8da82..70e24da11a 100644 --- a/docs/source/key-concepts-ledger.rst +++ b/docs/source/key-concepts-ledger.rst @@ -6,12 +6,15 @@ The ledger * *The ledger is subjective from each peer's perspective* * *Two peers are always guaranteed to see the exact same version of any on-ledger facts they share* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Overview -------- diff --git a/docs/source/key-concepts-node.rst b/docs/source/key-concepts-node.rst index 40844258e2..7e479060cb 100644 --- a/docs/source/key-concepts-node.rst +++ b/docs/source/key-concepts-node.rst @@ -11,13 +11,16 @@ Nodes * *The node's functionality is extended by installing CorDapps in the plugin registry* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + +

Corda Node, CorDapps and Network

+ +

-

Corda Node, CorDapps and Network

- -

Node architecture ----------------- diff --git a/docs/source/key-concepts-notaries.rst b/docs/source/key-concepts-notaries.rst index 6866382ae2..b3ac509bce 100644 --- a/docs/source/key-concepts-notaries.rst +++ b/docs/source/key-concepts-notaries.rst @@ -7,12 +7,15 @@ Notaries * *Notary clusters may optionally also validate transactions* * *A network can have several notary clusters, each running a different consensus algorithm* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Overview -------- diff --git a/docs/source/key-concepts-oracles.rst b/docs/source/key-concepts-oracles.rst index b5091800c9..24b51b7c27 100644 --- a/docs/source/key-concepts-oracles.rst +++ b/docs/source/key-concepts-oracles.rst @@ -6,12 +6,15 @@ Oracles * *A fact can be included in a transaction as part of a command* * *An oracle is a service that will only sign the transaction if the included fact is true* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Overview -------- diff --git a/docs/source/key-concepts-states.rst b/docs/source/key-concepts-states.rst index f4bf72be94..05c0b2928e 100644 --- a/docs/source/key-concepts-states.rst +++ b/docs/source/key-concepts-states.rst @@ -7,12 +7,15 @@ States * *States are evolved by marking the current state as historic and creating an updated state* * *Each node has a vault where it stores any relevant states to itself* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Overview -------- diff --git a/docs/source/key-concepts-time-windows.rst b/docs/source/key-concepts-time-windows.rst index c6002fa710..b28be1d45a 100644 --- a/docs/source/key-concepts-time-windows.rst +++ b/docs/source/key-concepts-time-windows.rst @@ -7,12 +7,15 @@ Time-windows * *The notary is the timestamping authority, refusing to commit transactions outside of that window* * *Time-windows can have a start and end time, or be open at either end* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Time in a distributed system ---------------------------- @@ -38,9 +41,19 @@ For this reason, times in transactions are specified as time *windows*, not abso there can never be "true time", only an approximation of it. Time windows can be open-ended (i.e. specify only one of "before" and "after") or they can be fully bounded. -.. image:: resources/time-window.gif - :scale: 25% - :align: center +.. only:: htmlmode + + .. image:: resources/time-window.gif + :scale: 25% + :align: center + + +.. only:: pdfmode + + .. image:: resources/time-window.png + :scale: 25% + :align: center + In this way, we express the idea that the *true value* of the fact "the current time" is actually unknowable. Even when both a before and an after time are included, the transaction could have occurred at any point within that time-window. diff --git a/docs/source/key-concepts-transactions.rst b/docs/source/key-concepts-transactions.rst index ff38a8b12b..6521ef2898 100644 --- a/docs/source/key-concepts-transactions.rst +++ b/docs/source/key-concepts-transactions.rst @@ -10,12 +10,15 @@ Transactions * *It is contractually valid* * *It is signed by the required parties* -Video ------ -.. raw:: html +.. only:: htmlmode + + Video + ----- + .. raw:: html + + +

- -

Overview -------- diff --git a/docs/source/resources/flow.png b/docs/source/resources/flow.png new file mode 100644 index 0000000000..76766dddde Binary files /dev/null and b/docs/source/resources/flow.png differ diff --git a/docs/source/resources/time-window.png b/docs/source/resources/time-window.png new file mode 100644 index 0000000000..ba23e2d80b Binary files /dev/null and b/docs/source/resources/time-window.png differ diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingClient.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingClient.kt index 07e60c673d..17775d1669 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingClient.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/ArtemisMessagingClient.kt @@ -50,7 +50,7 @@ class ArtemisMessagingClient( val locator = ActiveMQClient.createServerLocatorWithoutHA(tcpTransport).apply { // Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this // would be the default and the two lines below can be deleted. - connectionTTL = -1 + connectionTTL = 60000 clientFailureCheckPeriod = -1 minLargeMessageSize = maxMessageSize isUseGlobalPools = nodeSerializationEnv != null @@ -62,7 +62,7 @@ class ArtemisMessagingClient( // using our TLS certificate. // Note that the acknowledgement of messages is not flushed to the Artermis journal until the default buffer // size of 1MB is acknowledged. - val session = sessionFactory!!.createSession(NODE_P2P_USER, NODE_P2P_USER, false, autoCommitSends, autoCommitAcks, locator.isPreAcknowledge, DEFAULT_ACK_BATCH_SIZE) + val session = sessionFactory!!.createSession(NODE_P2P_USER, NODE_P2P_USER, false, autoCommitSends, autoCommitAcks, false, DEFAULT_ACK_BATCH_SIZE) session.start() // Create a general purpose producer. val producer = session.createProducer() diff --git a/node-api/src/main/resources/certificates/cordadevcakeys.jks b/node-api/src/main/resources/certificates/cordadevcakeys.jks index 3dc11f1fc5..ec72cb5081 100644 Binary files a/node-api/src/main/resources/certificates/cordadevcakeys.jks and b/node-api/src/main/resources/certificates/cordadevcakeys.jks differ diff --git a/node-api/src/main/resources/certificates/cordatruststore.jks b/node-api/src/main/resources/certificates/cordatruststore.jks index b91e35b8d5..97b4aebe18 100644 Binary files a/node-api/src/main/resources/certificates/cordatruststore.jks and b/node-api/src/main/resources/certificates/cordatruststore.jks differ diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/InternalRPCMessagingClient.kt b/node/src/main/kotlin/net/corda/node/services/messaging/InternalRPCMessagingClient.kt index dee6037413..b8d4001a5d 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/InternalRPCMessagingClient.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/InternalRPCMessagingClient.kt @@ -26,7 +26,7 @@ class InternalRPCMessagingClient(val sslConfig: SSLConfiguration, val serverAddr locator = ActiveMQClient.createServerLocatorWithoutHA(tcpTransport).apply { // Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this // would be the default and the two lines below can be deleted. - connectionTTL = -1 + connectionTTL = 60000 clientFailureCheckPeriod = -1 minLargeMessageSize = maxMessageSize isUseGlobalPools = nodeSerializationEnv != null diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt index 3261d52ed4..75ad11dc1e 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt @@ -26,11 +26,7 @@ import net.corda.core.serialization.SingletonSerializeAsToken import net.corda.core.serialization.deserialize import net.corda.core.serialization.internal.nodeSerializationEnv import net.corda.core.serialization.serialize -import net.corda.core.utilities.ByteSequence -import net.corda.core.utilities.NetworkHostAndPort -import net.corda.core.utilities.OpaqueBytes -import net.corda.core.utilities.contextLogger -import net.corda.core.utilities.trace +import net.corda.core.utilities.* import net.corda.node.VersionInfo import net.corda.node.internal.LifecycleSupport import net.corda.node.internal.artemis.ReactiveArtemisConsumer @@ -43,15 +39,12 @@ import net.corda.node.services.statemachine.SenderDeduplicationId import net.corda.node.utilities.AffinityExecutor import net.corda.nodeapi.ArtemisTcpTransport.Companion.p2pConnectorTcpTransport import net.corda.nodeapi.internal.ArtemisMessagingComponent -import net.corda.nodeapi.internal.ArtemisMessagingComponent.ArtemisAddress +import net.corda.nodeapi.internal.ArtemisMessagingComponent.* import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.BRIDGE_CONTROL import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.BRIDGE_NOTIFY import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.JOURNAL_HEADER_SIZE import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.P2PMessagingHeaders import net.corda.nodeapi.internal.ArtemisMessagingComponent.Companion.PEERS_PREFIX -import net.corda.nodeapi.internal.ArtemisMessagingComponent.NodeAddress -import net.corda.nodeapi.internal.ArtemisMessagingComponent.RemoteInboxAddress -import net.corda.nodeapi.internal.ArtemisMessagingComponent.ServiceAddress import net.corda.nodeapi.internal.bridging.BridgeControl import net.corda.nodeapi.internal.bridging.BridgeEntry import net.corda.nodeapi.internal.persistence.CordaPersistence @@ -61,12 +54,7 @@ import org.apache.activemq.artemis.api.core.Message.HDR_DUPLICATE_DETECTION_ID import org.apache.activemq.artemis.api.core.Message.HDR_VALIDATED_USER import org.apache.activemq.artemis.api.core.RoutingType import org.apache.activemq.artemis.api.core.SimpleString -import org.apache.activemq.artemis.api.core.client.ActiveMQClient -import org.apache.activemq.artemis.api.core.client.ClientConsumer -import org.apache.activemq.artemis.api.core.client.ClientMessage -import org.apache.activemq.artemis.api.core.client.ClientProducer -import org.apache.activemq.artemis.api.core.client.ClientSession -import org.apache.activemq.artemis.api.core.client.ServerLocator +import org.apache.activemq.artemis.api.core.client.* import rx.Observable import rx.Subscription import rx.subjects.PublishSubject @@ -167,7 +155,7 @@ class P2PMessagingClient(val config: NodeConfiguration, locator = ActiveMQClient.createServerLocatorWithoutHA(tcpTransport).apply { // Never time out on our loopback Artemis connections. If we switch back to using the InVM transport this // would be the default and the two lines below can be deleted. - connectionTTL = -1 + connectionTTL = 60000 clientFailureCheckPeriod = -1 minLargeMessageSize = maxMessageSize + JOURNAL_HEADER_SIZE isUseGlobalPools = nodeSerializationEnv != null @@ -178,7 +166,7 @@ class P2PMessagingClient(val config: NodeConfiguration, // using our TLS certificate. // Note that the acknowledgement of messages is not flushed to the Artermis journal until the default buffer // size of 1MB is acknowledged. - val createNewSession = { sessionFactory!!.createSession(ArtemisMessagingComponent.NODE_P2P_USER, ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, locator!!.isPreAcknowledge, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) } + val createNewSession = { sessionFactory!!.createSession(ArtemisMessagingComponent.NODE_P2P_USER, ArtemisMessagingComponent.NODE_P2P_USER, false, true, true, false, ActiveMQClient.DEFAULT_ACK_BATCH_SIZE) } producerSession = createNewSession() bridgeSession = createNewSession()