File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
hivemq-edge/src/main/java/com/hivemq/protocols Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -197,20 +197,17 @@ public boolean startSouthbound() {
197197 }
198198 return output .getStartFuture ();
199199 }, sharedAdapterExecutor ) // Use shared executor to reduce thread overhead
200- .thenCompose (Function .identity ()).handle ((ignored , error ) -> {
200+ .thenCompose (Function .identity ()).whenComplete ((ignored , error ) -> {
201201 if (error != null ) {
202202 log .error ("Error starting adapter" , error );
203203 stopAfterFailedStart ();
204- // Return null - cleanup done, adapter in STOPPED state
205- // Callers should check getRuntimeStatus() to determine if start succeeded
206- return null ;
207204 } else {
208- return attemptStartingConsumers (moduleServices .eventService ()).map (startException -> {
205+ attemptStartingConsumers (moduleServices .eventService ()).ifPresent (startException -> {
209206 log .error ("Failed to start adapter with id {}" , adapter .getId (), startException );
210207 stopAfterFailedStart ();
211- // Return null - cleanup done, adapter in STOPPED state
212- return ( Void ) null ;
213- }). orElse ( null ) ;
208+ // Propagate the exception - this will fail the future
209+ throw new RuntimeException ( "Failed to start consumers" , startException ) ;
210+ });
214211 }
215212 }).whenComplete ((result , throwable ) -> {
216213 // Clear the current operation when complete
You can’t perform that action at this time.
0 commit comments