This project contains some API classes to allow users to define their own scanners. This way the Distributed Communication Visualizer can be extended.
<dependency>
<groupId>com.hlag.tools.commvis</groupId>
<artifactId>api</artifactId>
<version>2.7.0</version>
</dependency>
Before writing your own/private scanner: If you are solving a general use cases, please think about contributing to https://github.com/Hapag-Lloyd/dist-comm-vis to help the community. Thanks!
The scanner is automatically detected if the Service
annotation from Spring is used and the scanner
is placed in the com.hlag.tools.commvis.analyzer.scanner.user
package.
package com.hlag.tools.commvis.analyzer.scanner.user;
// use this package name! Otherwise the scanner is not found
import com.hlag.tools.commvis.analyzer.model.ISenderReceiverCommunication;
import java.util.Collections;
import org.springframework.stereotype.Service;
@Service
public class MyUserDefinedScanner implements IScannerService {
@Override
public Collection<ISenderReceiverCommunication> scanSenderAndReceiver(String rootPackageName) {
// do whatever is necessary
return Collections.emptySet();
}
}
Scanning consumers (like http(s) endpoints or JMS receivers) is simple, but detecting the producers (e.g. methods calling a http(s) endpoint) is much harder or even impossible. To solve this problem a special annotation is provided:
@VisualizeHttpsCall(type="GET", path="/customer/{customerId}", projectId="1234", projectName="Customer Service")
Note 1: The projectName
is optional and might be nice to see in the code.
Note 2: There is always an annotation of the same name but ending in s
(e.g. @VisualizeHttpsCalls
) in case you need
to place more than one annotation on the method.
VisualizeSqsConsumer(queueName="location_sync", projectName="master data")