Skip to content

Repository files navigation

java-active-passive

JNATS Active / Passive Connection Extension

0.0.3

jnats canary

Active connection server pool selection

      ┌─────────────────────────────────────────────────────┐
      │ Did ApOptions have an active ApServerPool instance? │
      └─────────────────────────────────────────────────────┘
             │                          │
            YES                         NO
             │                          │
             ▼                          ▼
┌──────────────────────┐   ┌─────────────────────────────────────┐
│ Use that pool as the │   │ Did the user supply a server pool   │
│ server pool for the  │   │ in the regular connection Options?  │
│ active instance      │   └─────────────────────────────────────┘
└──────────────────────┘           │                     │
                                  YES                    NO
                                   │                     │
                                   ▼                     ▼
                ┌───────────────────────────┐  ┌────────────────────────────────┐
                │ Is that server pool an    │  │ Create an ApPassiveServerPool  │
                │ instance of ApServerPool? │  │ with a standard NatsServerPool │
                └───────────────────────────┘  │  as the delegate               │
                      │                │       └────────────────────────────────┘                       
                     YES               NO      
                      │                │
                      ▼                ▼
        ┌──────────────────────┐  ┌───────────────────────────────┐
        │ Use that pool as the │  │ Create an ApPassiveServerPool │
        │ server pool for the  │  │ with that pool as the         │
        │ active instance      │  │ delegate                      │
        └──────────────────────┘  └───────────────────────────────┘

Passive connection server pool selection

      ┌─────────────────────────────────────────────────────┐
      │ Did ApOptions have a passive ApServerPool instance? │
      └─────────────────────────────────────────────────────┘
             │                          │
            YES                         NO
             │                          │
             ▼                          ▼
┌──────────────────────┐   ┌────────────────────────────────┐
│ Use that pool as the │   │ Use the active server pool as  │
│ server pool for the  │   │ resolved above for the passive │
│ passive instance     │   │ instance                       │
└──────────────────────┘   └────────────────────────────────┘

About

JNATS Active / Passive Connection Extension

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages