2727import static org .dcache .util .Exceptions .messageOrClassName ;
2828
2929import com .google .common .base .Functions ;
30- import com .google .common .base .Throwables ;
3130import com .google .common .util .concurrent .AsyncFunction ;
3231import com .google .common .util .concurrent .Futures ;
3332import com .google .common .util .concurrent .ListenableFuture ;
8079import java .util .concurrent .ScheduledFuture ;
8180import java .util .concurrent .TimeUnit ;
8281import java .util .concurrent .atomic .AtomicReference ;
83- import java .util .function .Consumer ;
8482import java .util .function .Predicate ;
8583import java .util .stream .Collectors ;
8684import javax .annotation .Nonnull ;
119117import org .dcache .vehicles .FileAttributes ;
120118import org .slf4j .Logger ;
121119import org .slf4j .LoggerFactory ;
122- import org .springframework .beans .factory .annotation .Autowired ;
123- import org .springframework .beans .factory .annotation .Qualifier ;
124120import org .springframework .beans .factory .annotation .Required ;
125- import org .springframework .kafka .KafkaException ;
126- import org .springframework .kafka .core .KafkaTemplate ;
127121
128122/**
129123 * Entry point to and management interface for the nearline storage subsystem.
@@ -173,10 +167,6 @@ public record QueueStat(int queued, int active, int canceled) {
173167
174168 private CellAddressCore cellAddress ;
175169
176- private Consumer <StorageInfoMessage > _kafkaSender = (s ) -> {
177- };
178-
179-
180170 @ Override
181171 public void setCellAddress (CellAddressCore address ) {
182172 cellAddress = address ;
@@ -188,12 +178,6 @@ public void setScheduledExecutor(ScheduledExecutorService executor) {
188178 }
189179
190180
191- @ Autowired (required = false )
192- @ Qualifier ("hsm" )
193- public void setKafkaTemplate (KafkaTemplate kafkaTemplate ) {
194- _kafkaSender = kafkaTemplate ::sendDefault ;
195- }
196-
197181 @ Required
198182 public void setExecutor (ListeningExecutorService executor ) {
199183 this .executor = requireNonNull (executor );
@@ -1187,11 +1171,6 @@ private void done(@Nullable Throwable cause) {
11871171 addFromNearlineStorage (infoMsg , storage );
11881172
11891173 billingStub .notify (infoMsg );
1190- try {
1191- _kafkaSender .accept (infoMsg );
1192- } catch (KafkaException | org .apache .kafka .common .KafkaException e ) {
1193- LOGGER .warn ("Failed to send message to kafka: {} " , Throwables .getRootCause (e ).getMessage ());
1194- }
11951174 flushRequests .removeAndCallback (pnfsId , cause );
11961175 }
11971176
@@ -1421,11 +1400,6 @@ private void done(@Nullable Throwable cause) {
14211400 addFromNearlineStorage (infoMsg , storage );
14221401
14231402 billingStub .notify (infoMsg );
1424- try {
1425- _kafkaSender .accept (infoMsg );
1426- } catch (KafkaException | org .apache .kafka .common .KafkaException e ) {
1427- LOGGER .warn ("Failed to send message to kafka: {} " , Throwables .getRootCause (e ).getMessage ());
1428- }
14291403 stageRequests .removeAndCallback (pnfsId , cause );
14301404 }
14311405
0 commit comments