Package com.abusix.knsq.common
Class UtilKt
-
- All Implemented Interfaces:
public final class UtilKt
-
-
Method Summary
Modifier and Type Method Description final static Unit
closeQuietly(Closeable $self, Logger logger)
Close this Closeable without throwing any kind of an IOException, if it occurs. final static Boolean
isValidNSQTopicOrChannel(String $self)
Checks whether the current string is a valid NSQ topic or channel name or not. -
-
Method Detail
-
closeQuietly
final static Unit closeQuietly(Closeable $self, Logger logger)
Close this Closeable without throwing any kind of an IOException, if it occurs. Such exceptions will be logged on INFO level. Other Exceptions will still be thrown. This method might be useful for cleaning up connections whose current state is unclear.
-
isValidNSQTopicOrChannel
final static Boolean isValidNSQTopicOrChannel(String $self)
Checks whether the current string is a valid NSQ topic or channel name or not. In particular, this ensures:
Not empty
Maximum length of 64 characters
Only alphanumerical characters, dots, underscores or hyphens
A
#ephemeral
suffix is allowed and is also included in the maximum length
-
-
-
-